From patchwork Fri Jun 12 08:38:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Lambert X-Patchwork-Id: 6595971 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B43A99F2F4 for ; Fri, 12 Jun 2015 08:39:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E12B420663 for ; Fri, 12 Jun 2015 08:39:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 995282054A for ; Fri, 12 Jun 2015 08:39:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 88C3C2667FF; Fri, 12 Jun 2015 10:39:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8D0812666DE; Fri, 12 Jun 2015 10:39:27 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1F0F32666F0; Fri, 12 Jun 2015 10:39:27 +0200 (CEST) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by alsa0.perex.cz (Postfix) with ESMTP id 034B92666D3 for ; Fri, 12 Jun 2015 10:39:19 +0200 (CEST) Received: by wigg3 with SMTP id g3so10040794wig.1 for ; Fri, 12 Jun 2015 01:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to; bh=icZ7lcMfr0bFFVAAiipt4Z8O08LE0bYDb9sOXb15ZgU=; b=YM493P1lMLoOhE8oKe4+/SAoz+UBvhgp9IkkXClMBbm5+smWr7h/T2MzlyzGVlhjuv Wto0vRsZQmF6gwXb0d9NoeVQtVlvLpiTZteNznaiXzYoSA4UzDx9gzsgDsSQxvW75AJt JtERZulBBjO67eXkHjhrE2MWdlVDdkxTn71jKeEWEkTl1K+0jJyEsFZlGhQi4GWgp0cf 6KNn6gwjaMM4DCHal2Ix72SIjpTdx1GUeEwf58c9HrO/nZYlMizLZnlrKdQPyMzi3GsX 9G10zb7w6N51kBWXYpWLAzPP3V+8pzD02fMRo16EYCBcpfgw2uGHvczzRTDIcDf//R1A tA4g== X-Received: by 10.180.94.168 with SMTP id dd8mr4570601wib.76.1434098359716; Fri, 12 Jun 2015 01:39:19 -0700 (PDT) Received: from sloth.lip6.fr (hp-quentin.rsr.lip6.fr. [132.227.76.76]) by mx.google.com with ESMTPSA id u7sm1679738wif.3.2015.06.12.01.39.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jun 2015 01:39:18 -0700 (PDT) From: Quentin Lambert To: Johannes Berg , Jaroslav Kysela , Takashi Iwai , linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Date: Fri, 12 Jun 2015 10:38:41 +0200 Message-Id: <1434098322-12178-1-git-send-email-lambert.quentin@gmail.com> X-Mailer: git-send-email 2.3.2 In-Reply-To: <1432817307-28380-1-git-send-email-lambert.quentin@gmail.com> Cc: Quentin Lambert , kernel-janitors@vger.kernel.org Subject: [alsa-devel] [PATCH v3] ALSA: aoa: convert bus code to use dev_groups X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The dev_attrs field of struct bus_type is going away, sue dev_groups instead. This converts the soundbus code to use the correct field. These modifications were made using Coccinelle. Signed-off-by: Quentin Lambert --- Changes since v2: - Revert to the version of the patch where the files weren't merge. - Add a comment line to explain where xxx_attrs is defined as suggested by Takashi. sound/aoa/soundbus/core.c | 4 +++- sound/aoa/soundbus/soundbus.h | 2 +- sound/aoa/soundbus/sysfs.c | 13 ++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) --- a/sound/aoa/soundbus/core.c +++ b/sound/aoa/soundbus/core.c @@ -150,6 +150,8 @@ static int soundbus_device_resume(struct #endif /* CONFIG_PM */ +/* soundbus_dev_attrs is declared in sysfs.c */ +ATTRIBUTE_GROUPS(soundbus_dev); static struct bus_type soundbus_bus_type = { .name = "aoa-soundbus", .probe = soundbus_probe, @@ -160,7 +162,7 @@ static struct bus_type soundbus_bus_type .suspend = soundbus_device_suspend, .resume = soundbus_device_resume, #endif - .dev_attrs = soundbus_dev_attrs, + .dev_groups = soundbus_dev_groups, }; int soundbus_add_one(struct soundbus_dev *dev) --- a/sound/aoa/soundbus/soundbus.h +++ b/sound/aoa/soundbus/soundbus.h @@ -199,6 +199,6 @@ struct soundbus_driver { extern int soundbus_register_driver(struct soundbus_driver *drv); extern void soundbus_unregister_driver(struct soundbus_driver *drv); -extern struct device_attribute soundbus_dev_attrs[]; +extern struct attribute *soundbus_dev_attrs[]; #endif /* __SOUNDBUS_H */ --- a/sound/aoa/soundbus/sysfs.c +++ b/sound/aoa/soundbus/sysfs.c @@ -30,13 +30,16 @@ static ssize_t modalias_show(struct devi return length; } +static DEVICE_ATTR_RO(modalias); soundbus_config_of_attr (name, "%s\n"); +static DEVICE_ATTR_RO(name); soundbus_config_of_attr (type, "%s\n"); +static DEVICE_ATTR_RO(type); -struct device_attribute soundbus_dev_attrs[] = { - __ATTR_RO(name), - __ATTR_RO(type), - __ATTR_RO(modalias), - __ATTR_NULL +struct attribute *soundbus_dev_attrs[] = { + &dev_attr_name.attr, + &dev_attr_type.attr, + &dev_attr_modalias.attr, + NULL, };