From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932519AbbBPLvf (ORCPT ); Mon, 16 Feb 2015 06:51:35 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:43656 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752532AbbBPLve (ORCPT ); Mon, 16 Feb 2015 06:51:34 -0500 Date: Mon, 16 Feb 2015 11:51:27 +0000 From: Lee Jones To: Axel Lin Cc: Linus Walleij , Liam Girdwood , Mark Brown , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mfd: stw481x: Remove unused fields from struct stw481x Message-ID: <20150216115127.GA14545@x1> References: <1423805332.20498.2.camel@phoenix> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1423805332.20498.2.camel@phoenix> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Feb 2015, Axel Lin wrote: > The mutex lock is not used at all, remove it. > The *vmmc_regulator is not necessary, use a local variable in > stw481x_vmmc_regulator_probe() instead. > > Signed-off-by: Axel Lin > --- > drivers/regulator/stw481x-vmmc.c | 8 ++++---- > include/linux/mfd/stw481x.h | 4 ---- > 2 files changed, 4 insertions(+), 8 deletions(-) Acked-by: Lee Jones > diff --git a/drivers/regulator/stw481x-vmmc.c b/drivers/regulator/stw481x-vmmc.c > index 89025f5..7d2ae3e 100644 > --- a/drivers/regulator/stw481x-vmmc.c > +++ b/drivers/regulator/stw481x-vmmc.c > @@ -56,6 +56,7 @@ static int stw481x_vmmc_regulator_probe(struct platform_device *pdev) > { > struct stw481x *stw481x = dev_get_platdata(&pdev->dev); > struct regulator_config config = { }; > + struct regulator_dev *rdev; > int ret; > > /* First disable the external VMMC if it's active */ > @@ -75,12 +76,11 @@ static int stw481x_vmmc_regulator_probe(struct platform_device *pdev) > pdev->dev.of_node, > &vmmc_regulator); > > - stw481x->vmmc_regulator = devm_regulator_register(&pdev->dev, > - &vmmc_regulator, &config); > - if (IS_ERR(stw481x->vmmc_regulator)) { > + rdev = devm_regulator_register(&pdev->dev, &vmmc_regulator, &config); > + if (IS_ERR(rdev)) { > dev_err(&pdev->dev, > "error initializing STw481x VMMC regulator\n"); > - return PTR_ERR(stw481x->vmmc_regulator); > + return PTR_ERR(rdev); > } > > dev_info(&pdev->dev, "initialized STw481x VMMC regulator\n"); > diff --git a/include/linux/mfd/stw481x.h b/include/linux/mfd/stw481x.h > index eda1215..833074b 100644 > --- a/include/linux/mfd/stw481x.h > +++ b/include/linux/mfd/stw481x.h > @@ -41,15 +41,11 @@ > > /** > * struct stw481x - state holder for the Stw481x drivers > - * @mutex: mutex to serialize I2C accesses > * @i2c_client: corresponding I2C client > - * @regulator: regulator device for regulator children > * @map: regmap handle to access device registers > */ > struct stw481x { > - struct mutex lock; > struct i2c_client *client; > - struct regulator_dev *vmmc_regulator; > struct regmap *map; > }; > -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog