diff options
Diffstat (limited to 'drivers/extcon/extcon-max14577.c')
| -rw-r--r-- | drivers/extcon/extcon-max14577.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c index 2acf7461c905..d17dd4ff4d0f 100644 --- a/drivers/extcon/extcon-max14577.c +++ b/drivers/extcon/extcon-max14577.c | |||
| @@ -747,7 +747,7 @@ static int max14577_muic_probe(struct platform_device *pdev) | |||
| 747 | 747 | ||
| 748 | info->edev->name = dev_name(&pdev->dev); | 748 | info->edev->name = dev_name(&pdev->dev); |
| 749 | info->edev->supported_cable = max14577_extcon_cable; | 749 | info->edev->supported_cable = max14577_extcon_cable; |
| 750 | ret = extcon_dev_register(info->edev); | 750 | ret = devm_extcon_dev_register(&pdev->dev, info->edev); |
| 751 | if (ret) { | 751 | if (ret) { |
| 752 | dev_err(&pdev->dev, "failed to register extcon device\n"); | 752 | dev_err(&pdev->dev, "failed to register extcon device\n"); |
| 753 | return ret; | 753 | return ret; |
| @@ -766,7 +766,7 @@ static int max14577_muic_probe(struct platform_device *pdev) | |||
| 766 | MAX14577_REG_DEVICEID, &id); | 766 | MAX14577_REG_DEVICEID, &id); |
| 767 | if (ret < 0) { | 767 | if (ret < 0) { |
| 768 | dev_err(&pdev->dev, "failed to read revision number\n"); | 768 | dev_err(&pdev->dev, "failed to read revision number\n"); |
| 769 | goto err_extcon; | 769 | return ret; |
| 770 | } | 770 | } |
| 771 | dev_info(info->dev, "device ID : 0x%x\n", id); | 771 | dev_info(info->dev, "device ID : 0x%x\n", id); |
| 772 | 772 | ||
| @@ -786,10 +786,6 @@ static int max14577_muic_probe(struct platform_device *pdev) | |||
| 786 | delay_jiffies); | 786 | delay_jiffies); |
| 787 | 787 | ||
| 788 | return ret; | 788 | return ret; |
| 789 | |||
| 790 | err_extcon: | ||
| 791 | extcon_dev_unregister(info->edev); | ||
| 792 | return ret; | ||
| 793 | } | 789 | } |
| 794 | 790 | ||
| 795 | static int max14577_muic_remove(struct platform_device *pdev) | 791 | static int max14577_muic_remove(struct platform_device *pdev) |
| @@ -797,7 +793,6 @@ static int max14577_muic_remove(struct platform_device *pdev) | |||
| 797 | struct max14577_muic_info *info = platform_get_drvdata(pdev); | 793 | struct max14577_muic_info *info = platform_get_drvdata(pdev); |
| 798 | 794 | ||
| 799 | cancel_work_sync(&info->irq_work); | 795 | cancel_work_sync(&info->irq_work); |
| 800 | extcon_dev_unregister(info->edev); | ||
| 801 | 796 | ||
| 802 | return 0; | 797 | return 0; |
| 803 | } | 798 | } |
