lkml.org 
[lkml]   [2019]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] regulator: stpmic1: Remove regul_id and *regmap from struct stpmic1_regulator
Date
Hello Axel,

Le 02/09/2019 05:39 AM, Axel Lin a écrit :
> At the context with *rdev available, there is no problem to get regulator
> id and *regmap, so no need to store them in struct stpmic1_regulator.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/regulator/stpmic1_regulator.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/regulator/stpmic1_regulator.c b/drivers/regulator/stpmic1_regulator.c
> index 963e67fa9ca6..dd5c8fb1ff86 100644
> --- a/drivers/regulator/stpmic1_regulator.c
> +++ b/drivers/regulator/stpmic1_regulator.c
> @@ -30,20 +30,16 @@ struct stpmic1_regulator_cfg {
>
> /**
> * stpmic1 regulator data: this structure is used as driver data
> - * @regul_id: regulator id
> * @reg_node: DT node of regulator (unused on non-DT platforms)
> * @cfg: stpmic specific regulator description
> * @mask_reset: mask_reset bit value
> * @irq_curlim: current limit interrupt number
> - * @regmap: point to parent regmap structure
> */
> struct stpmic1_regulator {
> - unsigned int regul_id;
> struct device_node *reg_node;
> const struct stpmic1_regulator_cfg *cfg;
> u8 mask_reset;
> int irq_curlim;
> - struct regmap *regmap;
> };
>
> static int stpmic1_set_mode(struct regulator_dev *rdev, unsigned int mode);
> @@ -477,7 +473,7 @@ static int stpmic1_set_icc(struct regulator_dev *rdev)
> struct stpmic1_regulator *regul = rdev_get_drvdata(rdev);
>
> /* enable switch off in case of over current */
> - return regmap_update_bits(regul->regmap, regul->cfg->icc_reg,
> + return regmap_update_bits(rdev->regmap, regul->cfg->icc_reg,
> regul->cfg->icc_mask, regul->cfg->icc_mask);
Maybe this is not compatible with a recommandation from
include/linux/regulator/driver.h:438:
* This should *not* be used directly by anything except the regulator
* core and notification injection (which should take the mutex and do
* no other direct access).

> }
>
...


thank you,
pascal

\
 
 \ /
  Last update: 2019-02-11 09:47    [W:0.078 / U:6.852 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site