modem_if: Change hardcoded link enable gpio value
authorBeomho Seo <beomho.seo@samsung.com>
Fri, 18 Apr 2014 09:31:24 +0000 (18:31 +0900)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:29 +0000 (11:47 +0900)
Currently, link enable gpio is hardecoded to zero.
Zero equal gpa0-0 value. It is value for uart rxd line.
If link enable gpio is unused, it is don't have to call gpio request.
This patch change to set line enable gpio value optionally, and
remove unused variable 'ret'.

Change-Id: I4095d57d76362722abd5c5fd92ef529772680d97
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
drivers/misc/modem_if/sipc4_modem.c

index c4cd872..89892fa 100644 (file)
@@ -416,12 +416,10 @@ static struct modem_data *modem_parse_dt(struct platform_device *pdev, struct de
        mc->link_pm_data->gpio_link_enable = of_get_named_gpio(np, "link-enable-gpio", 0);
 
        /* link enable is optional */
-/*     if (!gpio_is_valid(mc->link_pm_data->gpio_link_enable)) {
-               mif_err("failed to get link-enable gpio\n");
-               return ERR_PTR(-EINVAL);
-       }*/
+       if (gpio_is_valid(mc->link_pm_data->gpio_link_enable))
+               devm_gpio_request(&pdev->dev, mc->link_pm_data->gpio_link_enable,
+                               "gpio_link_enable");
 
-       mc->link_pm_data->gpio_link_enable = 0;
 
        devm_gpio_request(&pdev->dev, mc->gpio_reset_req_n, "gpio_reset_req_n");
        devm_gpio_request(&pdev->dev, mc->gpio_cp_on, "gpio_cp_on");
@@ -432,7 +430,6 @@ static struct modem_data *modem_parse_dt(struct platform_device *pdev, struct de
        devm_gpio_request(&pdev->dev, mc->link_pm_data->gpio_link_slavewake, "gpio_link_slavewake");
        devm_gpio_request(&pdev->dev, mc->link_pm_data->gpio_link_hostwake, "gpio_link_hostwake");
        devm_gpio_request(&pdev->dev, mc->link_pm_data->gpio_link_active, "gpio_link_active");
-       devm_gpio_request(&pdev->dev, mc->link_pm_data->gpio_link_enable, "gpio_link_enable");
 
        platform_set_drvdata(pdev, mc);
 
@@ -449,7 +446,7 @@ dt_parse_err:
 
 static int modem_probe(struct platform_device *pdev)
 {
-       int i, ret;
+       int i;
        struct modem_data *pdata = pdev->dev.platform_data;
        struct modem_shared *msd = NULL;
        struct modem_ctl *modemctl = NULL;