Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'acpi-6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
"These fix the ACPI EC and AC drivers, the ACPI APEI error injection
driver and build issues related to the dev_is_pnp() macro referring to
pnp_bus_type that is not exported to modules.

Specifics:

- 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)

- Update the ACPI AC driver to use power_supply_changed() to let the
power supply core handle configuration changes properly (Thomas
Weißschuh)"

* tag 'acpi-6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: AC: Properly notify powermanagement core about changes
PNP: Hide pnp_bus_type from the non-PNP code
PNP: Make dev_is_pnp() to be a function and export it for modules
ACPI: EC: Avoid returning AE_OK on errors in address space handler
ACPI: EC: Abort address space access upon error
ACPI: APEI: EINJ: Fix einj_dev release leak

+21 -11
+2 -2
drivers/acpi/ac.c
··· 145 145 dev_name(&adev->dev), event, 146 146 (u32) ac->state); 147 147 acpi_notifier_call_chain(adev, event, (u32) ac->state); 148 - kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE); 148 + power_supply_changed(ac->charger); 149 149 } 150 150 } 151 151 ··· 268 268 if (acpi_ac_get_state(ac)) 269 269 return 0; 270 270 if (old_state != ac->state) 271 - kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE); 271 + power_supply_changed(ac->charger); 272 272 273 273 return 0; 274 274 }
+1 -1
drivers/acpi/apei/einj-core.c
··· 909 909 if (einj_initialized) 910 910 platform_driver_unregister(&einj_driver); 911 911 912 - platform_device_del(einj_dev); 912 + platform_device_unregister(einj_dev); 913 913 } 914 914 915 915 module_init(einj_init);
+7 -2
drivers/acpi/ec.c
··· 1333 1333 if (ec->busy_polling || bits > 8) 1334 1334 acpi_ec_burst_enable(ec); 1335 1335 1336 - for (i = 0; i < bytes; ++i, ++address, ++value) 1336 + for (i = 0; i < bytes; ++i, ++address, ++value) { 1337 1337 result = (function == ACPI_READ) ? 1338 1338 acpi_ec_read(ec, address, value) : 1339 1339 acpi_ec_write(ec, address, *value); 1340 + if (result < 0) 1341 + break; 1342 + } 1340 1343 1341 1344 if (ec->busy_polling || bits > 8) 1342 1345 acpi_ec_burst_disable(ec); ··· 1351 1348 return AE_NOT_FOUND; 1352 1349 case -ETIME: 1353 1350 return AE_TIME; 1354 - default: 1351 + case 0: 1355 1352 return AE_OK; 1353 + default: 1354 + return AE_ERROR; 1356 1355 } 1357 1356 } 1358 1357
+2 -2
drivers/acpi/sbs.c
··· 610 610 if (sbs->charger_exists) { 611 611 acpi_ac_get_present(sbs); 612 612 if (sbs->charger_present != saved_charger_state) 613 - kobject_uevent(&sbs->charger->dev.kobj, KOBJ_CHANGE); 613 + power_supply_changed(sbs->charger); 614 614 } 615 615 616 616 if (sbs->manager_present) { ··· 622 622 acpi_battery_read(bat); 623 623 if (saved_battery_state == bat->present) 624 624 continue; 625 - kobject_uevent(&bat->bat->dev.kobj, KOBJ_CHANGE); 625 + power_supply_changed(bat->bat); 626 626 } 627 627 } 628 628 }
+1
drivers/pnp/base.h
··· 6 6 7 7 extern struct mutex pnp_lock; 8 8 extern const struct attribute_group *pnp_dev_groups[]; 9 + extern const struct bus_type pnp_bus_type; 9 10 10 11 int pnp_register_protocol(struct pnp_protocol *protocol); 11 12 void pnp_unregister_protocol(struct pnp_protocol *protocol);
+6
drivers/pnp/driver.c
··· 266 266 .dev_groups = pnp_dev_groups, 267 267 }; 268 268 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 + 269 275 int pnp_register_driver(struct pnp_driver *drv) 270 276 { 271 277 drv->driver.name = drv->name;
+2 -4
include/linux/pnp.h
··· 435 435 #define protocol_for_each_dev(protocol, dev) \ 436 436 list_for_each_entry(dev, &(protocol)->devices, protocol_list) 437 437 438 - extern const struct bus_type pnp_bus_type; 439 - 440 438 #if defined(CONFIG_PNP) 441 439 442 440 /* device management */ ··· 467 469 int pnp_register_driver(struct pnp_driver *drv); 468 470 void pnp_unregister_driver(struct pnp_driver *drv); 469 471 470 - #define dev_is_pnp(d) ((d)->bus == &pnp_bus_type) 472 + bool dev_is_pnp(const struct device *dev); 471 473 472 474 #else 473 475 ··· 500 502 static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } 501 503 static inline void pnp_unregister_driver(struct pnp_driver *drv) { } 502 504 503 - #define dev_is_pnp(d) false 505 + static inline bool dev_is_pnp(const struct device *dev) { return false; } 504 506 505 507 #endif /* CONFIG_PNP */ 506 508