From patchwork Fri Jun 12 09:07:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Lambert X-Patchwork-Id: 6596351 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 03BAAC0020 for ; Fri, 12 Jun 2015 09:11:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31FEF20650 for ; Fri, 12 Jun 2015 09:11:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4DBF22038D for ; Fri, 12 Jun 2015 09:11:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752893AbbFLJL0 (ORCPT ); Fri, 12 Jun 2015 05:11:26 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:37451 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751089AbbFLJLY (ORCPT ); Fri, 12 Jun 2015 05:11:24 -0400 Received: by wifx6 with SMTP id x6so10953650wif.0; Fri, 12 Jun 2015 02:11:23 -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; bh=IIrMCu+0F2O4otHJzSpWVP7ef77OwZMXFf4mxD+HQ2w=; b=KmPJ6DsDO3p+mjvfyyA/dKFSU2Qn3cE/2dX3q4WXGeQAajlslepSpLqZqQi1aT8fib dt25entlGmilTeq3UE/KH0APUQrZlrcHUwKER8LvDja69cSTUznAHcl8rPzKqz12PZKu 7OFWgDNKxOPexghntA26Fzmz2a1HbOLtl+ItDx+VPpqB/BuL6Rz6+jbBPbIcqPSVMCla GyWCOlhthgmQf1cmZUTzIX2/sprgFCUVZhRfvtbdLe2d6tSYGW032O3/Y0QtVB/XkxQX 3ry+2Ml4fqrZu1+uVEc/3+09eqzhSZa+kx1tKN80EAkCUubbh6Zl7ugsTDURZCVO/ypw Gixw== X-Received: by 10.180.101.138 with SMTP id fg10mr4930929wib.46.1434100283180; Fri, 12 Jun 2015 02:11:23 -0700 (PDT) Received: from sloth.lip6.fr (hp-quentin.rsr.lip6.fr. [132.227.76.76]) by mx.google.com with ESMTPSA id nb9sm1779857wic.10.2015.06.12.02.11.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jun 2015 02:11:22 -0700 (PDT) From: Quentin Lambert To: Simon Horman , Magnus Damm , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, Quentin Lambert Subject: [PATCH] superhyway: convert code to use dev_groups Date: Fri, 12 Jun 2015 11:07:26 +0200 Message-Id: <1434100046-19467-1-git-send-email-lambert.quentin@gmail.com> X-Mailer: git-send-email 2.3.2 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The dev_attrs field of struct bus_type is going away, use dev_groups instead. This converts the soundbus code to use the correct field. These modifications were made using Coccinelle. Signed-off-by: Quentin Lambert --- drivers/sh/superhyway/superhyway-sysfs.c | 26 ++++++++++++++++---------- drivers/sh/superhyway/superhyway.c | 4 +++- include/linux/superhyway.h | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/sh/superhyway/superhyway-sysfs.c +++ b/drivers/sh/superhyway/superhyway-sysfs.c @@ -23,23 +23,29 @@ static ssize_t name##_show(struct device /* VCR flags */ superhyway_ro_attr(perr_flags, "0x%02x\n", vcr.perr_flags); +static DEVICE_ATTR_RO(perr_flags); superhyway_ro_attr(merr_flags, "0x%02x\n", vcr.merr_flags); +static DEVICE_ATTR_RO(merr_flags); superhyway_ro_attr(mod_vers, "0x%04x\n", vcr.mod_vers); +static DEVICE_ATTR_RO(mod_vers); superhyway_ro_attr(mod_id, "0x%04x\n", vcr.mod_id); +static DEVICE_ATTR_RO(mod_id); superhyway_ro_attr(bot_mb, "0x%02x\n", vcr.bot_mb); +static DEVICE_ATTR_RO(bot_mb); superhyway_ro_attr(top_mb, "0x%02x\n", vcr.top_mb); +static DEVICE_ATTR_RO(top_mb); /* Misc */ superhyway_ro_attr(resource, "0x%08lx\n", resource[0].start); +static DEVICE_ATTR_RO(resource); -struct device_attribute superhyway_dev_attrs[] = { - __ATTR_RO(perr_flags), - __ATTR_RO(merr_flags), - __ATTR_RO(mod_vers), - __ATTR_RO(mod_id), - __ATTR_RO(bot_mb), - __ATTR_RO(top_mb), - __ATTR_RO(resource), - __ATTR_NULL, +struct attribute *superhyway_dev_attrs[] = { + &dev_attr_perr_flags.attr, + &dev_attr_merr_flags.attr, + &dev_attr_mod_vers.attr, + &dev_attr_mod_id.attr, + &dev_attr_bot_mb.attr, + &dev_attr_top_mb.attr, + &dev_attr_resource.attr, + NULL, }; - --- a/drivers/sh/superhyway/superhyway.c +++ b/drivers/sh/superhyway/superhyway.c @@ -205,11 +205,13 @@ static int superhyway_bus_match(struct d return -ENODEV; } +/* superhyway_dev_attrs is defined in superhyway-sysfs.c */ +ATTRIBUTE_GROUPS(superhyway_dev); struct bus_type superhyway_bus_type = { .name = "superhyway", .match = superhyway_bus_match, #ifdef CONFIG_SYSFS - .dev_attrs = superhyway_dev_attrs, + .dev_groups = superhyway_dev_groups, #endif .probe = superhyway_device_probe, .remove = superhyway_device_remove, --- a/include/linux/superhyway.h +++ b/include/linux/superhyway.h @@ -101,7 +101,7 @@ int superhyway_add_device(unsigned long int superhyway_add_devices(struct superhyway_bus *bus, struct superhyway_device **devices, int nr_devices); /* drivers/sh/superhyway/superhyway-sysfs.c */ -extern struct device_attribute superhyway_dev_attrs[]; +extern struct attribute *superhyway_dev_attrs[]; #endif /* __LINUX_SUPERHYWAY_H */