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

Merge tag 'extcon-fixes-for-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next

Chanwoo writes:

Update extcon for v5.12-rc4

Detailed update of this pull request as following:
1. Add stubs of extcon_register_notifier_all() function for when
CONFIG_EXTCON is disabled.

2. Fix exception handling in extcon_dev_register() when failed to
initialize the extcon device.

* tag 'extcon-fixes-for-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon:
extcon: Fix error handling in extcon_dev_register
extcon: Add stubs for extcon_register_notifier_all() functions

+24
+1
drivers/extcon/extcon.c
··· 1241 1241 sizeof(*edev->nh), GFP_KERNEL); 1242 1242 if (!edev->nh) { 1243 1243 ret = -ENOMEM; 1244 + device_unregister(&edev->dev); 1244 1245 goto err_dev; 1245 1246 } 1246 1247
+23
include/linux/extcon.h
··· 271 271 struct extcon_dev *edev, unsigned int id, 272 272 struct notifier_block *nb) { } 273 273 274 + static inline int extcon_register_notifier_all(struct extcon_dev *edev, 275 + struct notifier_block *nb) 276 + { 277 + return 0; 278 + } 279 + 280 + static inline int extcon_unregister_notifier_all(struct extcon_dev *edev, 281 + struct notifier_block *nb) 282 + { 283 + return 0; 284 + } 285 + 286 + static inline int devm_extcon_register_notifier_all(struct device *dev, 287 + struct extcon_dev *edev, 288 + struct notifier_block *nb) 289 + { 290 + return 0; 291 + } 292 + 293 + static inline void devm_extcon_unregister_notifier_all(struct device *dev, 294 + struct extcon_dev *edev, 295 + struct notifier_block *nb) { } 296 + 274 297 static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name) 275 298 { 276 299 return ERR_PTR(-ENODEV);