summaryrefslogtreecommitdiff
path: root/drivers/extcon
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2015-09-29 16:57:24 +0300
committerChanwoo Choi <cw00.choi@samsung.com>2015-09-30 13:22:49 +0300
commitce6f7496050e29108bcefe0413df1789648fb38f (patch)
tree41f37b679c618de54acba780664705097ae7c01e /drivers/extcon
parent60f9b9e65c82cc610cc9c02c1f555df8fb2ce4f0 (diff)
downloadlinux-ce6f7496050e29108bcefe0413df1789648fb38f.tar.xz
extcon: gpio: Add the missing supported_cable parameter to devm_extcon_dev_allocate()
The commit 2a9de9c0 ("extcon: Use the unique id for external connector instead of string") defines the unique id of each external connector to identify the type of external connector instead of string name. So, devm_extcon_dev_allocate() should include the second parameter (unsigned int *supported_cable). This patch adds the supported_cable parameter which is passed by platform data. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-gpio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
index 2a89c89dfaf5..ba927df2fb91 100644
--- a/drivers/extcon/extcon-gpio.c
+++ b/drivers/extcon/extcon-gpio.c
@@ -70,17 +70,15 @@ static int gpio_extcon_probe(struct platform_device *pdev)
if (!pdata)
return -EBUSY;
- if (!pdata->irq_flags) {
- dev_err(&pdev->dev, "IRQ flag is not specified.\n");
+ if (!pdata->irq_flags || pdata->extcon_id > EXTCON_NONE)
return -EINVAL;
- }
data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_extcon_data),
GFP_KERNEL);
if (!data)
return -ENOMEM;
- data->edev = devm_extcon_dev_allocate(&pdev->dev, NULL);
+ data->edev = devm_extcon_dev_allocate(&pdev->dev, &pdata->extcon_id);
if (IS_ERR(data->edev)) {
dev_err(&pdev->dev, "failed to allocate extcon device\n");
return -ENOMEM;