Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 1bfc083

Browse files
committed
Merge branches 'acpi-ec', 'acpi-apei' and 'pnp'
Merge ACPI EC driver fixes, an ACPI APEI fix and PNP fixes for 6.10-rc3: - Fix error handling during EC operation region accesses in the ACPI EC driver (Armin Wolf). - Fix a memory leak in the APEI error injection driver introduced during its converion to a platform driver (Dan Williams). - Fix build failures related to the dev_is_pnp() macro by redefining it as a proper function and exporting it to modules as appropriate and unexport pnp_bus_type which need not be exported any more (Andy Shevchenko). * acpi-ec: ACPI: EC: Avoid returning AE_OK on errors in address space handler ACPI: EC: Abort address space access upon error * acpi-apei: ACPI: APEI: EINJ: Fix einj_dev release leak * pnp: PNP: Hide pnp_bus_type from the non-PNP code PNP: Make dev_is_pnp() to be a function and export it for modules
4 parents ac62f52 + c4bd7f1 + 7ff6c79 + edcde84 commit 1bfc083

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

drivers/acpi/apei/einj-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ static void __exit einj_exit(void)
909909
if (einj_initialized)
910910
platform_driver_unregister(&einj_driver);
911911

912-
platform_device_del(einj_dev);
912+
platform_device_unregister(einj_dev);
913913
}
914914

915915
module_init(einj_init);

drivers/acpi/ec.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,10 +1333,13 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
13331333
if (ec->busy_polling || bits > 8)
13341334
acpi_ec_burst_enable(ec);
13351335

1336-
for (i = 0; i < bytes; ++i, ++address, ++value)
1336+
for (i = 0; i < bytes; ++i, ++address, ++value) {
13371337
result = (function == ACPI_READ) ?
13381338
acpi_ec_read(ec, address, value) :
13391339
acpi_ec_write(ec, address, *value);
1340+
if (result < 0)
1341+
break;
1342+
}
13401343

13411344
if (ec->busy_polling || bits > 8)
13421345
acpi_ec_burst_disable(ec);
@@ -1348,8 +1351,10 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
13481351
return AE_NOT_FOUND;
13491352
case -ETIME:
13501353
return AE_TIME;
1351-
default:
1354+
case 0:
13521355
return AE_OK;
1356+
default:
1357+
return AE_ERROR;
13531358
}
13541359
}
13551360

drivers/pnp/base.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
extern struct mutex pnp_lock;
88
extern const struct attribute_group *pnp_dev_groups[];
9+
extern const struct bus_type pnp_bus_type;
910

1011
int pnp_register_protocol(struct pnp_protocol *protocol);
1112
void pnp_unregister_protocol(struct pnp_protocol *protocol);

drivers/pnp/driver.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ const struct bus_type pnp_bus_type = {
266266
.dev_groups = pnp_dev_groups,
267267
};
268268

269+
bool dev_is_pnp(const struct device *dev)
270+
{
271+
return dev->bus == &pnp_bus_type;
272+
}
273+
EXPORT_SYMBOL_GPL(dev_is_pnp);
274+
269275
int pnp_register_driver(struct pnp_driver *drv)
270276
{
271277
drv->driver.name = drv->name;

include/linux/pnp.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,6 @@ struct pnp_protocol {
435435
#define protocol_for_each_dev(protocol, dev) \
436436
list_for_each_entry(dev, &(protocol)->devices, protocol_list)
437437

438-
extern const struct bus_type pnp_bus_type;
439-
440438
#if defined(CONFIG_PNP)
441439

442440
/* device management */
@@ -469,7 +467,7 @@ int compare_pnp_id(struct pnp_id *pos, const char *id);
469467
int pnp_register_driver(struct pnp_driver *drv);
470468
void pnp_unregister_driver(struct pnp_driver *drv);
471469

472-
#define dev_is_pnp(d) ((d)->bus == &pnp_bus_type)
470+
bool dev_is_pnp(const struct device *dev);
473471

474472
#else
475473

@@ -502,7 +500,7 @@ static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -E
502500
static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
503501
static inline void pnp_unregister_driver(struct pnp_driver *drv) { }
504502

505-
#define dev_is_pnp(d) false
503+
static inline bool dev_is_pnp(const struct device *dev) { return false; }
506504

507505
#endif /* CONFIG_PNP */
508506

0 commit comments

Comments
 (0)