From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756397AbZELGkX (ORCPT ); Tue, 12 May 2009 02:40:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753479AbZELGkG (ORCPT ); Tue, 12 May 2009 02:40:06 -0400 Received: from cantor.suse.de ([195.135.220.2]:59737 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693AbZELGkF (ORCPT ); Tue, 12 May 2009 02:40:05 -0400 Date: Tue, 12 May 2009 08:40:05 +0200 Message-ID: From: Takashi Iwai To: Roel Kluin Cc: Greg Kroah-Hartman , johannes@sipsolutions.net, linuxppc-dev@ozlabs.org, alsa-devel@alsa-project.org, lkml Subject: Re: [alsa-devel] [PATCH] aoa: remove driver_data direct access of struct device In-Reply-To: <4A08828B.7090106@gmail.com> References: <4A08828B.7090106@gmail.com> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.3 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 11 May 2009 21:54:51 +0200, Roel Kluin wrote: > > To avoid direct access to the driver_data pointer in struct device, the > functions dev_get_drvdata() and dev_set_drvdata() should be used. > > Signed-off-by: Roel Kluin The same fix has been already in Greg's tree (and thus in linux-next). Greg, is it OK that I take over your patch to sound git tree? thanks, Takashi > --- > diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c > index fbf5c93..586965f 100644 > --- a/sound/aoa/fabrics/layout.c > +++ b/sound/aoa/fabrics/layout.c > @@ -1037,7 +1037,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) > } > ldev->selfptr_headphone.ptr = ldev; > ldev->selfptr_lineout.ptr = ldev; > - sdev->ofdev.dev.driver_data = ldev; > + dev_set_drvdata(&sdev->ofdev.dev, ldev); > list_add(&ldev->list, &layouts_list); > layouts_list_items++; > > @@ -1081,7 +1081,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) > > static int aoa_fabric_layout_remove(struct soundbus_dev *sdev) > { > - struct layout_dev *ldev = sdev->ofdev.dev.driver_data; > + struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); > int i; > > for (i=0; i @@ -1114,7 +1114,7 @@ static int aoa_fabric_layout_remove(struct soundbus_dev *sdev) > #ifdef CONFIG_PM > static int aoa_fabric_layout_suspend(struct soundbus_dev *sdev, pm_message_t state) > { > - struct layout_dev *ldev = sdev->ofdev.dev.driver_data; > + struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); > > if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off) > ldev->gpio.methods->all_amps_off(&ldev->gpio); > @@ -1124,7 +1124,7 @@ static int aoa_fabric_layout_suspend(struct soundbus_dev *sdev, pm_message_t sta > > static int aoa_fabric_layout_resume(struct soundbus_dev *sdev) > { > - struct layout_dev *ldev = sdev->ofdev.dev.driver_data; > + struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); > > if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off) > ldev->gpio.methods->all_amps_restore(&ldev->gpio); > diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c > index 418c84c..4e3b819 100644 > --- a/sound/aoa/soundbus/i2sbus/core.c > +++ b/sound/aoa/soundbus/i2sbus/core.c > @@ -358,14 +358,14 @@ static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match) > return -ENODEV; > } > > - dev->ofdev.dev.driver_data = control; > + dev_set_drvdata(&dev->ofdev.dev, control); > > return 0; > } > > static int i2sbus_remove(struct macio_dev* dev) > { > - struct i2sbus_control *control = dev->ofdev.dev.driver_data; > + struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev); > struct i2sbus_dev *i2sdev, *tmp; > > list_for_each_entry_safe(i2sdev, tmp, &control->list, item) > @@ -377,7 +377,7 @@ static int i2sbus_remove(struct macio_dev* dev) > #ifdef CONFIG_PM > static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state) > { > - struct i2sbus_control *control = dev->ofdev.dev.driver_data; > + struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev); > struct codec_info_item *cii; > struct i2sbus_dev* i2sdev; > int err, ret = 0; > @@ -407,7 +407,7 @@ static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state) > > static int i2sbus_resume(struct macio_dev* dev) > { > - struct i2sbus_control *control = dev->ofdev.dev.driver_data; > + struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev); > struct codec_info_item *cii; > struct i2sbus_dev* i2sdev; > int err, ret = 0; > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] aoa: remove driver_data direct access of struct device Date: Tue, 12 May 2009 08:40:05 +0200 Message-ID: References: <4A08828B.7090106@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 5AF5610381D for ; Tue, 12 May 2009 08:40:05 +0200 (CEST) In-Reply-To: <4A08828B.7090106@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Roel Kluin Cc: linuxppc-dev@ozlabs.org, johannes@sipsolutions.net, Greg Kroah-Hartman , alsa-devel@alsa-project.org, lkml List-Id: alsa-devel@alsa-project.org At Mon, 11 May 2009 21:54:51 +0200, Roel Kluin wrote: > > To avoid direct access to the driver_data pointer in struct device, the > functions dev_get_drvdata() and dev_set_drvdata() should be used. > > Signed-off-by: Roel Kluin The same fix has been already in Greg's tree (and thus in linux-next). Greg, is it OK that I take over your patch to sound git tree? thanks, Takashi > --- > diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c > index fbf5c93..586965f 100644 > --- a/sound/aoa/fabrics/layout.c > +++ b/sound/aoa/fabrics/layout.c > @@ -1037,7 +1037,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) > } > ldev->selfptr_headphone.ptr = ldev; > ldev->selfptr_lineout.ptr = ldev; > - sdev->ofdev.dev.driver_data = ldev; > + dev_set_drvdata(&sdev->ofdev.dev, ldev); > list_add(&ldev->list, &layouts_list); > layouts_list_items++; > > @@ -1081,7 +1081,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) > > static int aoa_fabric_layout_remove(struct soundbus_dev *sdev) > { > - struct layout_dev *ldev = sdev->ofdev.dev.driver_data; > + struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); > int i; > > for (i=0; i @@ -1114,7 +1114,7 @@ static int aoa_fabric_layout_remove(struct soundbus_dev *sdev) > #ifdef CONFIG_PM > static int aoa_fabric_layout_suspend(struct soundbus_dev *sdev, pm_message_t state) > { > - struct layout_dev *ldev = sdev->ofdev.dev.driver_data; > + struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); > > if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off) > ldev->gpio.methods->all_amps_off(&ldev->gpio); > @@ -1124,7 +1124,7 @@ static int aoa_fabric_layout_suspend(struct soundbus_dev *sdev, pm_message_t sta > > static int aoa_fabric_layout_resume(struct soundbus_dev *sdev) > { > - struct layout_dev *ldev = sdev->ofdev.dev.driver_data; > + struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); > > if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off) > ldev->gpio.methods->all_amps_restore(&ldev->gpio); > diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c > index 418c84c..4e3b819 100644 > --- a/sound/aoa/soundbus/i2sbus/core.c > +++ b/sound/aoa/soundbus/i2sbus/core.c > @@ -358,14 +358,14 @@ static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match) > return -ENODEV; > } > > - dev->ofdev.dev.driver_data = control; > + dev_set_drvdata(&dev->ofdev.dev, control); > > return 0; > } > > static int i2sbus_remove(struct macio_dev* dev) > { > - struct i2sbus_control *control = dev->ofdev.dev.driver_data; > + struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev); > struct i2sbus_dev *i2sdev, *tmp; > > list_for_each_entry_safe(i2sdev, tmp, &control->list, item) > @@ -377,7 +377,7 @@ static int i2sbus_remove(struct macio_dev* dev) > #ifdef CONFIG_PM > static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state) > { > - struct i2sbus_control *control = dev->ofdev.dev.driver_data; > + struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev); > struct codec_info_item *cii; > struct i2sbus_dev* i2sdev; > int err, ret = 0; > @@ -407,7 +407,7 @@ static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state) > > static int i2sbus_resume(struct macio_dev* dev) > { > - struct i2sbus_control *control = dev->ofdev.dev.driver_data; > + struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev); > struct codec_info_item *cii; > struct i2sbus_dev* i2sdev; > int err, ret = 0; > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx1.suse.de", Issuer "CAcert Class 3 Root" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 8A5D5DDE1B for ; Tue, 12 May 2009 16:40:10 +1000 (EST) Date: Tue, 12 May 2009 08:40:05 +0200 Message-ID: From: Takashi Iwai To: Roel Kluin Subject: Re: [alsa-devel] [PATCH] aoa: remove driver_data direct access of struct device In-Reply-To: <4A08828B.7090106@gmail.com> References: <4A08828B.7090106@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: linuxppc-dev@ozlabs.org, johannes@sipsolutions.net, Greg Kroah-Hartman , alsa-devel@alsa-project.org, lkml List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , At Mon, 11 May 2009 21:54:51 +0200, Roel Kluin wrote: > > To avoid direct access to the driver_data pointer in struct device, the > functions dev_get_drvdata() and dev_set_drvdata() should be used. > > Signed-off-by: Roel Kluin The same fix has been already in Greg's tree (and thus in linux-next). Greg, is it OK that I take over your patch to sound git tree? thanks, Takashi > --- > diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c > index fbf5c93..586965f 100644 > --- a/sound/aoa/fabrics/layout.c > +++ b/sound/aoa/fabrics/layout.c > @@ -1037,7 +1037,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) > } > ldev->selfptr_headphone.ptr = ldev; > ldev->selfptr_lineout.ptr = ldev; > - sdev->ofdev.dev.driver_data = ldev; > + dev_set_drvdata(&sdev->ofdev.dev, ldev); > list_add(&ldev->list, &layouts_list); > layouts_list_items++; > > @@ -1081,7 +1081,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) > > static int aoa_fabric_layout_remove(struct soundbus_dev *sdev) > { > - struct layout_dev *ldev = sdev->ofdev.dev.driver_data; > + struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); > int i; > > for (i=0; i @@ -1114,7 +1114,7 @@ static int aoa_fabric_layout_remove(struct soundbus_dev *sdev) > #ifdef CONFIG_PM > static int aoa_fabric_layout_suspend(struct soundbus_dev *sdev, pm_message_t state) > { > - struct layout_dev *ldev = sdev->ofdev.dev.driver_data; > + struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); > > if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off) > ldev->gpio.methods->all_amps_off(&ldev->gpio); > @@ -1124,7 +1124,7 @@ static int aoa_fabric_layout_suspend(struct soundbus_dev *sdev, pm_message_t sta > > static int aoa_fabric_layout_resume(struct soundbus_dev *sdev) > { > - struct layout_dev *ldev = sdev->ofdev.dev.driver_data; > + struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); > > if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off) > ldev->gpio.methods->all_amps_restore(&ldev->gpio); > diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c > index 418c84c..4e3b819 100644 > --- a/sound/aoa/soundbus/i2sbus/core.c > +++ b/sound/aoa/soundbus/i2sbus/core.c > @@ -358,14 +358,14 @@ static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match) > return -ENODEV; > } > > - dev->ofdev.dev.driver_data = control; > + dev_set_drvdata(&dev->ofdev.dev, control); > > return 0; > } > > static int i2sbus_remove(struct macio_dev* dev) > { > - struct i2sbus_control *control = dev->ofdev.dev.driver_data; > + struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev); > struct i2sbus_dev *i2sdev, *tmp; > > list_for_each_entry_safe(i2sdev, tmp, &control->list, item) > @@ -377,7 +377,7 @@ static int i2sbus_remove(struct macio_dev* dev) > #ifdef CONFIG_PM > static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state) > { > - struct i2sbus_control *control = dev->ofdev.dev.driver_data; > + struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev); > struct codec_info_item *cii; > struct i2sbus_dev* i2sdev; > int err, ret = 0; > @@ -407,7 +407,7 @@ static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state) > > static int i2sbus_resume(struct macio_dev* dev) > { > - struct i2sbus_control *control = dev->ofdev.dev.driver_data; > + struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev); > struct codec_info_item *cii; > struct i2sbus_dev* i2sdev; > int err, ret = 0; > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >