Skip to content

Commit

Permalink
Merge tag 'extcon-fixes-for-5.12-rc4' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Greg Kroah-Hartman committed Mar 15, 2021
2 parents 1e28eed + d3bdd1c commit e01b7d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/extcon/extcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,7 @@ int extcon_dev_register(struct extcon_dev *edev)
sizeof(*edev->nh), GFP_KERNEL);
if (!edev->nh) {
ret = -ENOMEM;
device_unregister(&edev->dev);
goto err_dev;
}

Expand Down
23 changes: 23 additions & 0 deletions include/linux/extcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,29 @@ static inline void devm_extcon_unregister_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb) { }

static inline int extcon_register_notifier_all(struct extcon_dev *edev,
struct notifier_block *nb)
{
return 0;
}

static inline int extcon_unregister_notifier_all(struct extcon_dev *edev,
struct notifier_block *nb)
{
return 0;
}

static inline int devm_extcon_register_notifier_all(struct device *dev,
struct extcon_dev *edev,
struct notifier_block *nb)
{
return 0;
}

static inline void devm_extcon_unregister_notifier_all(struct device *dev,
struct extcon_dev *edev,
struct notifier_block *nb) { }

static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)
{
return ERR_PTR(-ENODEV);
Expand Down

0 comments on commit e01b7d0

Please sign in to comment.