There are no external users of backlight_put(). Drop it and open code the two users in backlight.c.
Unified · Split
| @@ -718,7 +718,10 @@ EXPORT_SYMBOL(of_find_backlight); · 717 unmodified lines | |||
| 718 | 718 | ||
| 719 | static void devm_backlight_release(void *data) | 719 | static void devm_backlight_release(void *data) |
| 720 | { | 720 | { |
| 721 | backlight_put(data); | 721 | struct backlight_device *bd = data; |
| 722 | |||
| 723 | if (bd) | ||
| 724 | put_device(&bd->dev); | ||
| 722 | } | 725 | } |
| 723 | 726 | ||
| 724 | /** | 727 | /** |
| @@ -746,7 +749,7 @@ struct backlight_device *devm_of_find_backlight(struct device *dev) · 21 unmodified lines | |||
| 746 | return bd; | 749 | return bd; |
| 747 | ret = devm_add_action(dev, devm_backlight_release, bd); | 750 | ret = devm_add_action(dev, devm_backlight_release, bd); |
| 748 | if (ret) { | 751 | if (ret) { |
| 749 | backlight_put(bd); | 752 | put_device(&bd->dev); |
| 750 | return ERR_PTR(ret); | 753 | return ERR_PTR(ret); |
| 751 | } | 754 | } |
| 752 | return bd; | 755 | return bd; |
| @@ -388,16 +388,6 @@ static inline int backlight_disable(struct backlight_device *bd) · 387 unmodified lines | |||
| 388 | return backlight_update_status(bd); | 388 | return backlight_update_status(bd); |
| 389 | } | 389 | } |
| 390 | 390 | ||
| 391 | /** | ||
| 392 | * backlight_put - Drop backlight reference | ||
| 393 | * @bd: the backlight device to put | ||
| 394 | */ | ||
| 395 | static inline void backlight_put(struct backlight_device *bd) | ||
| 396 | { | ||
| 397 | if (bd) | ||
| 398 | put_device(&bd->dev); | ||
| 399 | } | ||
| 400 | |||
| 401 | /** | 391 | /** |
| 402 | * backlight_is_blank - Return true if display is expected to be blank | 392 | * backlight_is_blank - Return true if display is expected to be blank |
| 403 | * @bd: the backlight device | 393 | * @bd: the backlight device |