aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon_gpio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 14:25:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 14:25:33 -0400
commitfa93669a1917f93b09142d4b2298329b82d7d36d (patch)
tree7f8d6dc9d1fbb086c59a799a3a7137c46fb9959e /drivers/extcon/extcon_gpio.c
parentb13bc8dda81c54a66a1c84e66f60b8feba659f28 (diff)
parent6791457a090d9a234a40b501c2536f0aefaeae4b (diff)
Merge tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core changes from Greg Kroah-Hartman: "Here's the big driver core pull request for 3.6-rc1. Unlike 3.5, this kernel should be a lot tamer, with the printk changes now settled down. All we have here is some extcon driver updates, w1 driver updates, a few printk cleanups that weren't needed for 3.5, but are good to have now, and some other minor fixes/changes in the driver core. All of these have been in the linux-next releases for a while now. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (38 commits) printk: Export struct log size and member offsets through vmcoreinfo Drivers: hv: Change the hex constant to a decimal constant driver core: don't trigger uevent after failure extcon: MAX77693: Add extcon-max77693 driver to support Maxim MAX77693 MUIC device sysfs: fail dentry revalidation after namespace change fix sysfs: fail dentry revalidation after namespace change extcon: spelling of detach in function doc extcon: arizona: Stop microphone detection if we give up on it extcon: arizona: Update cable reporting calls and split headset PM / Runtime: Do not increment device usage counts before probing kmsg - do not flush partial lines when the console is busy kmsg - export "continuation record" flag to /dev/kmsg kmsg - avoid warning for CONFIG_PRINTK=n compilations kmsg - properly print over-long continuation lines driver-core: Use kobj_to_dev instead of re-implementing it driver-core: Move kobj_to_dev from genhd.h to device.h driver core: Move deferred devices to the end of dpm_list before probing driver core: move uevent call to driver_register driver core: fix shutdown races with probe/remove(v3) Extcon: Arizona: Add driver for Wolfson Arizona class devices ...
Diffstat (limited to 'drivers/extcon/extcon_gpio.c')
-rw-r--r--drivers/extcon/extcon_gpio.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/extcon/extcon_gpio.c b/drivers/extcon/extcon_gpio.c
index 8a0dcc11c7c7..fe3db45fa83c 100644
--- a/drivers/extcon/extcon_gpio.c
+++ b/drivers/extcon/extcon_gpio.c
@@ -105,25 +105,25 @@ static int __devinit gpio_extcon_probe(struct platform_device *pdev)
105 105
106 ret = extcon_dev_register(&extcon_data->edev, &pdev->dev); 106 ret = extcon_dev_register(&extcon_data->edev, &pdev->dev);
107 if (ret < 0) 107 if (ret < 0)
108 goto err_extcon_dev_register; 108 return ret;
109 109
110 ret = gpio_request_one(extcon_data->gpio, GPIOF_DIR_IN, pdev->name); 110 ret = gpio_request_one(extcon_data->gpio, GPIOF_DIR_IN, pdev->name);
111 if (ret < 0) 111 if (ret < 0)
112 goto err_request_gpio; 112 goto err;
113 113
114 INIT_DELAYED_WORK(&extcon_data->work, gpio_extcon_work); 114 INIT_DELAYED_WORK(&extcon_data->work, gpio_extcon_work);
115 115
116 extcon_data->irq = gpio_to_irq(extcon_data->gpio); 116 extcon_data->irq = gpio_to_irq(extcon_data->gpio);
117 if (extcon_data->irq < 0) { 117 if (extcon_data->irq < 0) {
118 ret = extcon_data->irq; 118 ret = extcon_data->irq;
119 goto err_detect_irq_num_failed; 119 goto err;
120 } 120 }
121 121
122 ret = request_any_context_irq(extcon_data->irq, gpio_irq_handler, 122 ret = request_any_context_irq(extcon_data->irq, gpio_irq_handler,
123 pdata->irq_flags, pdev->name, 123 pdata->irq_flags, pdev->name,
124 extcon_data); 124 extcon_data);
125 if (ret < 0) 125 if (ret < 0)
126 goto err_request_irq; 126 goto err;
127 127
128 platform_set_drvdata(pdev, extcon_data); 128 platform_set_drvdata(pdev, extcon_data);
129 /* Perform initial detection */ 129 /* Perform initial detection */
@@ -131,13 +131,8 @@ static int __devinit gpio_extcon_probe(struct platform_device *pdev)
131 131
132 return 0; 132 return 0;
133 133
134err_request_irq: 134err:
135err_detect_irq_num_failed:
136 gpio_free(extcon_data->gpio);
137err_request_gpio:
138 extcon_dev_unregister(&extcon_data->edev); 135 extcon_dev_unregister(&extcon_data->edev);
139err_extcon_dev_register:
140 devm_kfree(&pdev->dev, extcon_data);
141 136
142 return ret; 137 return ret;
143} 138}
@@ -148,9 +143,7 @@ static int __devexit gpio_extcon_remove(struct platform_device *pdev)
148 143
149 cancel_delayed_work_sync(&extcon_data->work); 144 cancel_delayed_work_sync(&extcon_data->work);
150 free_irq(extcon_data->irq, extcon_data); 145 free_irq(extcon_data->irq, extcon_data);
151 gpio_free(extcon_data->gpio);
152 extcon_dev_unregister(&extcon_data->edev); 146 extcon_dev_unregister(&extcon_data->edev);
153 devm_kfree(&pdev->dev, extcon_data);
154 147
155 return 0; 148 return 0;
156} 149}