From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Chris Ball <cjb@laptop.org>, Ulf Hansson <ulf.hansson@linaro.org>,
Konstantin Dorfman <kdorfman@codeaurora.org>,
Seungwon Jeon <tgih.jun@samsung.com>, <linux-mmc@vger.kernel.org>
Subject: [PATCH 04/11] MMC: convert bus code to use dev_groups
Date: Sun, 6 Oct 2013 23:55:43 -0700 [thread overview]
Message-ID: <1381128950-28125-5-git-send-email-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <1381128950-28125-1-git-send-email-gregkh@linuxfoundation.org>
The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead. This converts the MMC bus code to use the
correct field.
Cc: Chris Ball <cjb@laptop.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Konstantin Dorfman <kdorfman@codeaurora.org>
Cc: Seungwon Jeon <tgih.jun@samsung.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Chris, I can take this through my driver-core tree if you like, just let
me know what would be the easiest for you.
drivers/mmc/core/bus.c | 12 +++++++-----
drivers/mmc/core/sdio_bus.c | 21 ++++++++++++---------
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 704bf66..3e227bd 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -27,7 +27,7 @@
#define to_mmc_driver(d) container_of(d, struct mmc_driver, drv)
-static ssize_t mmc_type_show(struct device *dev,
+static ssize_t type_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct mmc_card *card = mmc_dev_to_card(dev);
@@ -45,11 +45,13 @@ static ssize_t mmc_type_show(struct device *dev,
return -EFAULT;
}
}
+static DEVICE_ATTR_RO(type);
-static struct device_attribute mmc_dev_attrs[] = {
- __ATTR(type, S_IRUGO, mmc_type_show, NULL),
- __ATTR_NULL,
+static struct attribute *mmc_dev_attrs[] = {
+ &dev_attr_type.attr,
+ NULL,
};
+ATTRIBUTE_GROUPS(mmc_dev);
/*
* This currently matches any MMC driver to any MMC card - drivers
@@ -218,7 +220,7 @@ static const struct dev_pm_ops mmc_bus_pm_ops = {
static struct bus_type mmc_bus_type = {
.name = "mmc",
- .dev_attrs = mmc_dev_attrs,
+ .dev_groups = mmc_dev_groups,
.match = mmc_bus_match,
.uevent = mmc_bus_uevent,
.probe = mmc_bus_probe,
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 6d67492..ef89565 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -34,7 +34,8 @@ field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
\
func = dev_to_sdio_func (dev); \
return sprintf (buf, format_string, func->field); \
-}
+} \
+static DEVICE_ATTR_RO(field)
sdio_config_attr(class, "0x%02x\n");
sdio_config_attr(vendor, "0x%04x\n");
@@ -47,14 +48,16 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
return sprintf(buf, "sdio:c%02Xv%04Xd%04X\n",
func->class, func->vendor, func->device);
}
-
-static struct device_attribute sdio_dev_attrs[] = {
- __ATTR_RO(class),
- __ATTR_RO(vendor),
- __ATTR_RO(device),
- __ATTR_RO(modalias),
- __ATTR_NULL,
+static DEVICE_ATTR_RO(modalias);
+
+static struct attribute *sdio_dev_attrs[] = {
+ &dev_attr_class.attr,
+ &dev_attr_vendor.attr,
+ &dev_attr_device.attr,
+ &dev_attr_modalias.attr,
+ NULL,
};
+ATTRIBUTE_GROUPS(sdio_dev);
static const struct sdio_device_id *sdio_match_one(struct sdio_func *func,
const struct sdio_device_id *id)
@@ -225,7 +228,7 @@ static const struct dev_pm_ops sdio_bus_pm_ops = {
static struct bus_type sdio_bus_type = {
.name = "sdio",
- .dev_attrs = sdio_dev_attrs,
+ .dev_groups = sdio_dev_groups,
.match = sdio_bus_match,
.uevent = sdio_bus_uevent,
.probe = sdio_bus_probe,
--
1.8.4.6.g82e253f.dirty
next prev parent reply other threads:[~2013-10-07 6:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 6:55 [PATCH 00/11] driver core bus cleanup to use dev_groups Greg Kroah-Hartman
2013-10-07 6:55 ` [PATCH 01/11] pci: convert bus code " Greg Kroah-Hartman
2013-10-07 18:21 ` Bjorn Helgaas
2013-10-07 20:41 ` Greg Kroah-Hartman
2013-10-07 20:47 ` Bjorn Helgaas
2013-10-07 21:18 ` Bjorn Helgaas
2013-10-07 6:55 ` [PATCH 02/11] mdio_bus: " Greg Kroah-Hartman
2013-10-07 6:55 ` [PATCH 03/11] PNP: " Greg Kroah-Hartman
2013-10-07 21:27 ` Rafael J. Wysocki
2013-10-07 6:55 ` Greg Kroah-Hartman [this message]
2013-10-07 6:55 ` [PATCH 05/11] uwb: " Greg Kroah-Hartman
2013-10-07 6:55 ` [PATCH 06/11] bcma: " Greg Kroah-Hartman
2013-10-09 15:13 ` John W. Linville
2013-10-10 8:08 ` Rafał Miłecki
2013-10-07 6:55 ` [PATCH 07/11] pcmcia: " Greg Kroah-Hartman
2013-10-07 6:55 ` [PATCH 08/11] rapidio: " Greg Kroah-Hartman
2013-10-07 6:55 ` [PATCH 09/11] ssb: " Greg Kroah-Hartman
2013-10-07 6:55 ` [PATCH 10/11] xenbus: " Greg Kroah-Hartman
2013-10-07 16:34 ` Boris Ostrovsky
2013-10-07 6:55 ` [PATCH 11/11] hsi: " Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381128950-28125-5-git-send-email-gregkh@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=cjb@laptop.org \
--cc=kdorfman@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=tgih.jun@samsung.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).