aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-adc-jack.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/extcon/extcon-adc-jack.c')
-rw-r--r--drivers/extcon/extcon-adc-jack.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index 5985807e52c9..e23f1c2e5053 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -27,16 +27,16 @@
27 27
28/** 28/**
29 * struct adc_jack_data - internal data for adc_jack device driver 29 * struct adc_jack_data - internal data for adc_jack device driver
30 * @edev - extcon device. 30 * @edev: extcon device.
31 * @cable_names - list of supported cables. 31 * @cable_names: list of supported cables.
32 * @num_cables - size of cable_names. 32 * @num_cables: size of cable_names.
33 * @adc_conditions - list of adc value conditions. 33 * @adc_conditions: list of adc value conditions.
34 * @num_conditions - size of adc_conditions. 34 * @num_conditions: size of adc_conditions.
35 * @irq - irq number of attach/detach event (0 if not exist). 35 * @irq: irq number of attach/detach event (0 if not exist).
36 * @handling_delay - interrupt handler will schedule extcon event 36 * @handling_delay: interrupt handler will schedule extcon event
37 * handling at handling_delay jiffies. 37 * handling at handling_delay jiffies.
38 * @handler - extcon event handler called by interrupt handler. 38 * @handler: extcon event handler called by interrupt handler.
39 * @chan - iio channel being queried. 39 * @chan: iio channel being queried.
40 */ 40 */
41struct adc_jack_data { 41struct adc_jack_data {
42 struct extcon_dev edev; 42 struct extcon_dev edev;
@@ -64,7 +64,7 @@ static void adc_jack_handler(struct work_struct *work)
64 64
65 ret = iio_read_channel_raw(data->chan, &adc_val); 65 ret = iio_read_channel_raw(data->chan, &adc_val);
66 if (ret < 0) { 66 if (ret < 0) {
67 dev_err(data->edev.dev, "read channel() error: %d\n", ret); 67 dev_err(&data->edev.dev, "read channel() error: %d\n", ret);
68 return; 68 return;
69 } 69 }
70 70
@@ -95,7 +95,7 @@ static irqreturn_t adc_jack_irq_thread(int irq, void *_data)
95static int adc_jack_probe(struct platform_device *pdev) 95static int adc_jack_probe(struct platform_device *pdev)
96{ 96{
97 struct adc_jack_data *data; 97 struct adc_jack_data *data;
98 struct adc_jack_pdata *pdata = pdev->dev.platform_data; 98 struct adc_jack_pdata *pdata = dev_get_platdata(&pdev->dev);
99 int i, err = 0; 99 int i, err = 0;
100 100
101 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 101 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
@@ -110,6 +110,7 @@ static int adc_jack_probe(struct platform_device *pdev)
110 goto out; 110 goto out;
111 } 111 }
112 112
113 data->edev.dev.parent = &pdev->dev;
113 data->edev.supported_cable = pdata->cable_names; 114 data->edev.supported_cable = pdata->cable_names;
114 115
115 /* Check the length of array and set num_cables */ 116 /* Check the length of array and set num_cables */
@@ -148,7 +149,7 @@ static int adc_jack_probe(struct platform_device *pdev)
148 149
149 platform_set_drvdata(pdev, data); 150 platform_set_drvdata(pdev, data);
150 151
151 err = extcon_dev_register(&data->edev, &pdev->dev); 152 err = extcon_dev_register(&data->edev);
152 if (err) 153 if (err)
153 goto out; 154 goto out;
154 155