From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754943Ab0ETWwS (ORCPT ); Thu, 20 May 2010 18:52:18 -0400 Received: from mga09.intel.com ([134.134.136.24]:10047 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753133Ab0ETWwQ (ORCPT ); Thu, 20 May 2010 18:52:16 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,273,1272870000"; d="scan'208";a="623488691" Date: Fri, 21 May 2010 00:52:10 +0200 From: Samuel Ortiz To: Wolfram Sang Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, Jean Delvare , stable@kernel.org Subject: Re: [PATCH] drivers/mfd: remove unneeded and dangerous clearing of clientdata Message-ID: <20100520225209.GC3130@sortiz.org> References: <1274098229-13858-1-git-send-email-w.sang@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1274098229-13858-1-git-send-email-w.sang@pengutronix.de> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wolfgang, On Mon, May 17, 2010 at 02:10:29PM +0200, Wolfram Sang wrote: > Unlike real i2c-devices which get detached from the driver, dummy-devices get > truly unregistered. So, there has never been a need to clear the clientdata > because the device will go away anyhow. For the occasions fixed here, clearing > clientdata was even dangerous as the structure was freed already. Patch applied, many thanks. Cheers, Samuel. > Signed-off-by: Wolfram Sang > Cc: Jean Delvare > Cc: Samuel Ortiz > Cc: stable@kernel.org > --- > > Note: While most of the other calls clearing clientdata became superfluous > meanwhile and will be fixed later to remove redundancy, this is a seperate > issue. It was wrong from the beginning and needs to be fixed as it can cause > crashes. Hopefully, during this release-cycle, all other clearings of > clientdata will be removed and we will never see the related confusion again. > > drivers/mfd/88pm860x-i2c.c | 1 - > drivers/mfd/max8925-i2c.c | 2 -- > 2 files changed, 0 insertions(+), 3 deletions(-) > > diff --git a/drivers/mfd/88pm860x-i2c.c b/drivers/mfd/88pm860x-i2c.c > index 4a6e718..e55f3d2 100644 > --- a/drivers/mfd/88pm860x-i2c.c > +++ b/drivers/mfd/88pm860x-i2c.c > @@ -200,7 +200,6 @@ static int __devexit pm860x_remove(struct i2c_client *client) > > pm860x_device_exit(chip); > i2c_unregister_device(chip->companion); > - i2c_set_clientdata(chip->companion, NULL); > i2c_set_clientdata(chip->client, NULL); > kfree(chip); > return 0; > diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c > index d9fd878..e73f3f5 100644 > --- a/drivers/mfd/max8925-i2c.c > +++ b/drivers/mfd/max8925-i2c.c > @@ -173,8 +173,6 @@ static int __devexit max8925_remove(struct i2c_client *client) > max8925_device_exit(chip); > i2c_unregister_device(chip->adc); > i2c_unregister_device(chip->rtc); > - i2c_set_clientdata(chip->adc, NULL); > - i2c_set_clientdata(chip->rtc, NULL); > i2c_set_clientdata(chip->i2c, NULL); > kfree(chip); > return 0; > -- > 1.7.0 > -- Intel Open Source Technology Centre http://oss.intel.com/