Commit 8ab3343d authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Liam Girdwood

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: default avatarDmitry Torokhov <dtor@mail.ru>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 98bf7c05
...@@ -32,8 +32,8 @@ struct fixed_voltage_data { ...@@ -32,8 +32,8 @@ struct fixed_voltage_data {
int microvolts; int microvolts;
int gpio; int gpio;
unsigned startup_delay; unsigned startup_delay;
unsigned enable_high:1; bool enable_high;
unsigned is_enabled:1; bool is_enabled;
}; };
static int fixed_voltage_is_enabled(struct regulator_dev *dev) static int fixed_voltage_is_enabled(struct regulator_dev *dev)
...@@ -49,7 +49,7 @@ static int fixed_voltage_enable(struct regulator_dev *dev) ...@@ -49,7 +49,7 @@ static int fixed_voltage_enable(struct regulator_dev *dev)
if (gpio_is_valid(data->gpio)) { if (gpio_is_valid(data->gpio)) {
gpio_set_value_cansleep(data->gpio, data->enable_high); gpio_set_value_cansleep(data->gpio, data->enable_high);
data->is_enabled = 1; data->is_enabled = true;
} }
return 0; return 0;
...@@ -61,7 +61,7 @@ static int fixed_voltage_disable(struct regulator_dev *dev) ...@@ -61,7 +61,7 @@ static int fixed_voltage_disable(struct regulator_dev *dev)
if (gpio_is_valid(data->gpio)) { if (gpio_is_valid(data->gpio)) {
gpio_set_value_cansleep(data->gpio, !data->enable_high); gpio_set_value_cansleep(data->gpio, !data->enable_high);
data->is_enabled = 0; data->is_enabled = false;
} }
return 0; return 0;
...@@ -101,7 +101,7 @@ static struct regulator_ops fixed_voltage_ops = { ...@@ -101,7 +101,7 @@ static struct regulator_ops fixed_voltage_ops = {
.list_voltage = fixed_voltage_list_voltage, .list_voltage = fixed_voltage_list_voltage,
}; };
static int regulator_fixed_voltage_probe(struct platform_device *pdev) static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
{ {
struct fixed_voltage_config *config = pdev->dev.platform_data; struct fixed_voltage_config *config = pdev->dev.platform_data;
struct fixed_voltage_data *drvdata; struct fixed_voltage_data *drvdata;
...@@ -174,7 +174,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev) ...@@ -174,7 +174,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)
/* Regulator without GPIO control is considered /* Regulator without GPIO control is considered
* always enabled * always enabled
*/ */
drvdata->is_enabled = 1; drvdata->is_enabled = true;
} }
drvdata->dev = regulator_register(&drvdata->desc, &pdev->dev, drvdata->dev = regulator_register(&drvdata->desc, &pdev->dev,
...@@ -202,7 +202,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev) ...@@ -202,7 +202,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int regulator_fixed_voltage_remove(struct platform_device *pdev) static int __devexit reg_fixed_voltage_remove(struct platform_device *pdev)
{ {
struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev); struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev);
...@@ -216,10 +216,11 @@ static int regulator_fixed_voltage_remove(struct platform_device *pdev) ...@@ -216,10 +216,11 @@ static int regulator_fixed_voltage_remove(struct platform_device *pdev)
} }
static struct platform_driver regulator_fixed_voltage_driver = { static struct platform_driver regulator_fixed_voltage_driver = {
.probe = regulator_fixed_voltage_probe, .probe = reg_fixed_voltage_probe,
.remove = regulator_fixed_voltage_remove, .remove = __devexit_p(reg_fixed_voltage_remove),
.driver = { .driver = {
.name = "reg-fixed-voltage", .name = "reg-fixed-voltage",
.owner = THIS_MODULE,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment