lkml.org 
[lkml]   [2021]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 2/5] regulator: hi6421v600-regulator: fix platform drvdata
Em Sat, 26 Jun 2021 11:41:50 +0800
Axel Lin <axel.lin@ingics.com> escreveu:

> > @@ -231,7 +228,7 @@ static int hi6421_spmi_regulator_probe(struct platform_device *pdev)
> > {
> > struct device *pmic_dev = pdev->dev.parent;
> > struct regulator_config config = { };
> > - struct hi6421_spmi_reg_priv *priv;
> > + struct hi6421_spmi_reg_info *sreg;
> > struct hi6421_spmi_reg_info *info;
> > struct device *dev = &pdev->dev;
> > struct hi6421_spmi_pmic *pmic;
> > @@ -247,18 +244,17 @@ static int hi6421_spmi_regulator_probe(struct platform_device *pdev)
> > if (WARN_ON(!pmic))
> > return -ENODEV;
> >
> > - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> > - if (!priv)
> > + sreg = devm_kzalloc(dev, sizeof(*sreg), GFP_KERNEL);
> > + if (!sreg)
> > return -ENOMEM;
> >
> > - mutex_init(&priv->enable_mutex);
> > - platform_set_drvdata(pdev, priv);
> > + sreg->enable_mutex = &pmic->enable_mutex;
> >
> > for (i = 0; i < ARRAY_SIZE(regulator_info); i++) {
> > info = &regulator_info[i];
> >
> > config.dev = pdev->dev.parent;
> > - config.driver_data = info;
> > + config.driver_data = sreg;
>
> This won't work and that was what my patch fixed.
> e.g. When you call
> struct hi6421_spmi_reg_info *sreg = rdev_get_drvdata(rdev);
> sreg->eco_mode_mask and sreg->eco_uA will always be 0.

Yeah, probably something got lost during the several rebases.
Anyway, I'll send in a few a new patch series addressing this issue.

Thanks,
Mauro

\
 
 \ /
  Last update: 2021-06-29 12:25    [W:0.048 / U:1.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site