diff options
Diffstat (limited to 'net/rfkill/rfkill-gpio.c')
-rw-r--r-- | net/rfkill/rfkill-gpio.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 436bffb68868..9c4a5eb91cbf 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c | |||
@@ -36,8 +36,6 @@ struct rfkill_gpio_data { | |||
36 | struct gpio_desc *shutdown_gpio; | 36 | struct gpio_desc *shutdown_gpio; |
37 | 37 | ||
38 | struct rfkill *rfkill_dev; | 38 | struct rfkill *rfkill_dev; |
39 | char *reset_name; | ||
40 | char *shutdown_name; | ||
41 | struct clk *clk; | 39 | struct clk *clk; |
42 | 40 | ||
43 | bool clk_enabled; | 41 | bool clk_enabled; |
@@ -89,7 +87,6 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
89 | struct rfkill_gpio_data *rfkill; | 87 | struct rfkill_gpio_data *rfkill; |
90 | struct gpio_desc *gpio; | 88 | struct gpio_desc *gpio; |
91 | int ret; | 89 | int ret; |
92 | int len; | ||
93 | 90 | ||
94 | rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL); | 91 | rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL); |
95 | if (!rfkill) | 92 | if (!rfkill) |
@@ -106,21 +103,9 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
106 | return -ENODEV; | 103 | return -ENODEV; |
107 | } | 104 | } |
108 | 105 | ||
109 | len = strlen(rfkill->name); | ||
110 | rfkill->reset_name = devm_kzalloc(&pdev->dev, len + 7, GFP_KERNEL); | ||
111 | if (!rfkill->reset_name) | ||
112 | return -ENOMEM; | ||
113 | |||
114 | rfkill->shutdown_name = devm_kzalloc(&pdev->dev, len + 10, GFP_KERNEL); | ||
115 | if (!rfkill->shutdown_name) | ||
116 | return -ENOMEM; | ||
117 | |||
118 | snprintf(rfkill->reset_name, len + 6 , "%s_reset", rfkill->name); | ||
119 | snprintf(rfkill->shutdown_name, len + 9, "%s_shutdown", rfkill->name); | ||
120 | |||
121 | rfkill->clk = devm_clk_get(&pdev->dev, NULL); | 106 | rfkill->clk = devm_clk_get(&pdev->dev, NULL); |
122 | 107 | ||
123 | gpio = devm_gpiod_get_index(&pdev->dev, rfkill->reset_name, 0); | 108 | gpio = devm_gpiod_get_index(&pdev->dev, "reset", 0); |
124 | if (!IS_ERR(gpio)) { | 109 | if (!IS_ERR(gpio)) { |
125 | ret = gpiod_direction_output(gpio, 0); | 110 | ret = gpiod_direction_output(gpio, 0); |
126 | if (ret) | 111 | if (ret) |
@@ -128,7 +113,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
128 | rfkill->reset_gpio = gpio; | 113 | rfkill->reset_gpio = gpio; |
129 | } | 114 | } |
130 | 115 | ||
131 | gpio = devm_gpiod_get_index(&pdev->dev, rfkill->shutdown_name, 1); | 116 | gpio = devm_gpiod_get_index(&pdev->dev, "shutdown", 1); |
132 | if (!IS_ERR(gpio)) { | 117 | if (!IS_ERR(gpio)) { |
133 | ret = gpiod_direction_output(gpio, 0); | 118 | ret = gpiod_direction_output(gpio, 0); |
134 | if (ret) | 119 | if (ret) |