aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-02-24 02:37:55 -0500
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-03-03 09:49:27 -0500
commit8ab3343dc61552cb8ad653e1013b1853cea9bea6 (patch)
tree7770a28418846d9d84f60d59a5c22b55fd2c695c
parent98bf7c057b35eaf418ac063c4aba4f9f86220b09 (diff)
Regulators: fixed - annotate probe and remove methods
Add __devinit/__devexit markings to probe and remove methids of the driver, change types of variables containing boolean data to boolean, set up driver's owner field so we have proper sysfs link between driver and the module. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--drivers/regulator/fixed.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index a3d3bfc24b1f..d11f7622430b 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -32,8 +32,8 @@ struct fixed_voltage_data {
32 int microvolts; 32 int microvolts;
33 int gpio; 33 int gpio;
34 unsigned startup_delay; 34 unsigned startup_delay;
35 unsigned enable_high:1; 35 bool enable_high;
36 unsigned is_enabled:1; 36 bool is_enabled;
37}; 37};
38 38
39static int fixed_voltage_is_enabled(struct regulator_dev *dev) 39static int fixed_voltage_is_enabled(struct regulator_dev *dev)
@@ -49,7 +49,7 @@ static int fixed_voltage_enable(struct regulator_dev *dev)
49 49
50 if (gpio_is_valid(data->gpio)) { 50 if (gpio_is_valid(data->gpio)) {
51 gpio_set_value_cansleep(data->gpio, data->enable_high); 51 gpio_set_value_cansleep(data->gpio, data->enable_high);
52 data->is_enabled = 1; 52 data->is_enabled = true;
53 } 53 }
54 54
55 return 0; 55 return 0;
@@ -61,7 +61,7 @@ static int fixed_voltage_disable(struct regulator_dev *dev)
61 61
62 if (gpio_is_valid(data->gpio)) { 62 if (gpio_is_valid(data->gpio)) {
63 gpio_set_value_cansleep(data->gpio, !data->enable_high); 63 gpio_set_value_cansleep(data->gpio, !data->enable_high);
64 data->is_enabled = 0; 64 data->is_enabled = false;
65 } 65 }
66 66
67 return 0; 67 return 0;
@@ -101,7 +101,7 @@ static struct regulator_ops fixed_voltage_ops = {
101 .list_voltage = fixed_voltage_list_voltage, 101 .list_voltage = fixed_voltage_list_voltage,
102}; 102};
103 103
104static int regulator_fixed_voltage_probe(struct platform_device *pdev) 104static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
105{ 105{
106 struct fixed_voltage_config *config = pdev->dev.platform_data; 106 struct fixed_voltage_config *config = pdev->dev.platform_data;
107 struct fixed_voltage_data *drvdata; 107 struct fixed_voltage_data *drvdata;
@@ -174,7 +174,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)
174 /* Regulator without GPIO control is considered 174 /* Regulator without GPIO control is considered
175 * always enabled 175 * always enabled
176 */ 176 */
177 drvdata->is_enabled = 1; 177 drvdata->is_enabled = true;
178 } 178 }
179 179
180 drvdata->dev = regulator_register(&drvdata->desc, &pdev->dev, 180 drvdata->dev = regulator_register(&drvdata->desc, &pdev->dev,
@@ -202,7 +202,7 @@ err:
202 return ret; 202 return ret;
203} 203}
204 204
205static int regulator_fixed_voltage_remove(struct platform_device *pdev) 205static int __devexit reg_fixed_voltage_remove(struct platform_device *pdev)
206{ 206{
207 struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev); 207 struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev);
208 208
@@ -216,10 +216,11 @@ static int regulator_fixed_voltage_remove(struct platform_device *pdev)
216} 216}
217 217
218static struct platform_driver regulator_fixed_voltage_driver = { 218static struct platform_driver regulator_fixed_voltage_driver = {
219 .probe = regulator_fixed_voltage_probe, 219 .probe = reg_fixed_voltage_probe,
220 .remove = regulator_fixed_voltage_remove, 220 .remove = __devexit_p(reg_fixed_voltage_remove),
221 .driver = { 221 .driver = {
222 .name = "reg-fixed-voltage", 222 .name = "reg-fixed-voltage",
223 .owner = THIS_MODULE,
223 }, 224 },
224}; 225};
225 226