diff options
author | Milo Kim <milo.kim@ti.com> | 2015-08-25 09:07:07 +0300 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-09-22 14:35:29 +0300 |
commit | 87d931d56970d014a7074ca57f11baadc4e6d834 (patch) | |
tree | 6f5af45c903a305e9df2fb24292a3082fcd52f0d /drivers/power/da9150-charger.c | |
parent | c01576c8f3445208036eac72ea6703b452d42612 (diff) | |
download | linux-87d931d56970d014a7074ca57f11baadc4e6d834.tar.xz |
power:lp8727_charger: use the private data instead of updating I2C device platform data
Currently, lp8727 charger driver parses the DT and copies values into the
'cl->dev.platform_data' if 'of_node' exists.
This may have architectural issue. Platform data is configurable through
the DT or I2C board info inside the platform area.
However, lp8727 driver changes this configuration when it is loaded.
The driver should get data from the platform side and use the private
data, 'lp8727_chg->pdata' instead of changing the original platform data.
_probe() procedure is changed as follows.
1. lp8727_parse_dt() returns the pointer of lp8727_platform_data.
The driver uses this allocated platform data. So it should keep
original platform data, 'dev->platform_data'.
2. In _probe(), check the return value of lp8727_parse_dt().
If an error is found, then exit as PTR_ERR(pdata).
3. If 'of_node' is not found, then the driver just gets the platform data
from the I2C device structure.
4. Map the platform data to private data structure.
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power/da9150-charger.c')
0 files changed, 0 insertions, 0 deletions