From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755591Ab0HIHfB (ORCPT ); Mon, 9 Aug 2010 03:35:01 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:41917 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755418Ab0HIHfA convert rfc822-to-8bit (ORCPT ); Mon, 9 Aug 2010 03:35:00 -0400 References: <1281324445.12901.1.camel@mola> (sfid-20100809_042548_456204_B2C4C107) Message-Id: From: Mark Brown To: Axel Lin In-Reply-To: <1281324445.12901.1.camel@mola> (sfid-20100809_042548_456204_B2C4C107) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT X-Mailer: iPad Mail (7B405) Mime-Version: 1.0 (iPad Mail 7B405) Subject: Re: [PATCH] regulator: tps6507x - add missing platform_set_drvdata in tps6507x_pmic_probe Date: Mon, 9 Aug 2010 08:35:08 +0100 Cc: linux-kernel , Liam Girdwood , Anuj Aggarwal Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9 Aug 2010, at 04:27, Axel Lin wrote: > We should call platform_set_drvdata() before calling platform_get_drvdata(). > > Signed-off-by: Axel Lin > --- > drivers/regulator/tps6507x-regulator.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c > index 8152d65..fbe21f7 100644 > --- a/drivers/regulator/tps6507x-regulator.c > +++ b/drivers/regulator/tps6507x-regulator.c > @@ -614,6 +614,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev) > } > > tps6507x_dev->pmic = tps; > + platform_set_drvdata(pdev, tps6507x_dev); > > return 0; > > @@ -640,6 +641,7 @@ static int __devexit tps6507x_pmic_remove(struct platform_device *pdev) > for (i = 0; i < TPS6507X_NUM_REGULATOR; i++) > regulator_unregister(tps->rdev[i]); > > + platform_set_drvdata(pdev, NULL); > kfree(tps); This is not needed - we're unbinding the driver so should no longer be looking at the driver data. > > return 0; > -- > 1.5.4.3 > > >