mbox series

[v3,0/3] power: supply: max8998-charger: Device Tree support

Message ID 1531843509-3533-1-git-send-email-pawel.mikolaj.chmiel@gmail.com
Headers show
Series power: supply: max8998-charger: Device Tree support | expand

Message

Paweł Chmiel July 17, 2018, 4:05 p.m. UTC
This patch series compose of 3 patches.

First patch, fixes platform data retrieval issue in max8998 charger
driver, which could cause NULL pointer dereference.

Second patch, updates max8998 charger driver, so it's possible to parse
devicetree for configuration.

Third patch, updates max8998 documentation, so it includes new node 
and properties, needed for charger.

All patches has been tested on, Samsung Galaxy S (i9000) phone.

Changes from v2:
  - Make charge-restart-level-microvolt and charge-timeout-hours
    properties optional. If they're not present, assume they're disabled.

Changes from v1:
  - Removed unneeded Fixes tag
  - Correct description of all charger values
  - Added missing property unit for charger properties
  - Removed already applied patch

Paweł Chmiel (2):
  power: supply: max8998-charger: Parse device tree for required data.
  dt-bindings: mfd: max8998: Add charger subnode binding

Tomasz Figa (1):
  power: supply: max8998-charger: Fix platform data retrieval

 Documentation/devicetree/bindings/mfd/max8998.txt | 25 +++++++++
 drivers/power/supply/max8998_charger.c            | 62 ++++++++++++++++++++++-
 2 files changed, 86 insertions(+), 1 deletion(-)

Comments

Sebastian Reichel Sept. 16, 2018, 11:47 a.m. UTC | #1
Hi,

On Tue, Jul 17, 2018 at 06:05:07PM +0200, Paweł Chmiel wrote:
> From: Tomasz Figa <tomasz.figa@gmail.com>
> 
> Since the max8998 MFD driver supports instantiation by DT, platform data
> retrieval is handled in MFD probe and cell drivers should get use
> the pdata field of max8998_dev struct to obtain them.
> 
> Fixes: ee999fb3f17f ("mfd: max8998: Add support for Device Tree")
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/max8998_charger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/max8998_charger.c b/drivers/power/supply/max8998_charger.c
> index b64cf0f14142..66438029bdd0 100644
> --- a/drivers/power/supply/max8998_charger.c
> +++ b/drivers/power/supply/max8998_charger.c
> @@ -85,7 +85,7 @@ static const struct power_supply_desc max8998_battery_desc = {
>  static int max8998_battery_probe(struct platform_device *pdev)
>  {
>  	struct max8998_dev *iodev = dev_get_drvdata(pdev->dev.parent);
> -	struct max8998_platform_data *pdata = dev_get_platdata(iodev->dev);
> +	struct max8998_platform_data *pdata = iodev->pdata;
>  	struct power_supply_config psy_cfg = {};
>  	struct max8998_battery_data *max8998;
>  	struct i2c_client *i2c;
> -- 
> 2.7.4
>