Re: [PATCH v2] regulator: bd718x7: Remove struct bd718xx_pmic

From: Matti Vaittinen
Date: Thu Oct 04 2018 - 02:42:49 EST


Hello Axel,

On Wed, Oct 03, 2018 at 11:32:46PM +0800, Axel Lin wrote:
> All the fields in struct bd718xx_pmic are not really necessary.
> Remove struct bd718xx_pmic to simplify the code.
>
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
> ---
> v2:
> Sorry, just update the subject line.
>
> drivers/regulator/bd718x7-regulator.c | 59 +++++++++------------------
> 1 file changed, 20 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c
> index d2522d4e1505..3a47e0372e77 100644
> --- a/drivers/regulator/bd718x7-regulator.c
> +++ b/drivers/regulator/bd718x7-regulator.c
> @@ -15,13 +15,6 @@
> #include <linux/regulator/of_regulator.h>
> #include <linux/slab.h>
>
> -struct bd718xx_pmic {
> - struct bd718xx_regulator_data *rdata;
> - struct bd718xx *mfd;
> - struct platform_device *pdev;
> - struct regulator_dev *rdev[BD718XX_REGULATOR_AMOUNT];
> -};

You should then also remove the references to struct bd718xx_pmic from
include/linux/mfd/rohm-bd718x7.h. Now we have there:

struct bd71837_pmic;
struct bd71837_clk;

struct bd71837 {
struct device *dev;
struct regmap *regmap;
unsigned long int id;

int chip_irq;
struct regmap_irq_chip_data *irq_data;

struct bd71837_pmic *pmic;
struct bd71837_clk *clk;
};

Other than that - simplifications are always welcome.
Reviewed-by: Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx>