Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f24fc57b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

MMC: convert bus code to use dev_groups



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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2df43901
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@


#define to_mmc_driver(d)	container_of(d, struct mmc_driver, drv)
#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 device_attribute *attr, char *buf)
{
{
	struct mmc_card *card = mmc_dev_to_card(dev);
	struct mmc_card *card = mmc_dev_to_card(dev);
@@ -45,11 +45,13 @@ static ssize_t mmc_type_show(struct device *dev,
		return -EFAULT;
		return -EFAULT;
	}
	}
}
}
static DEVICE_ATTR_RO(type);


static struct device_attribute mmc_dev_attrs[] = {
static struct attribute *mmc_dev_attrs[] = {
	__ATTR(type, S_IRUGO, mmc_type_show, NULL),
	&dev_attr_type.attr,
	__ATTR_NULL,
	NULL,
};
};
ATTRIBUTE_GROUPS(mmc_dev);


/*
/*
 * This currently matches any MMC driver to any MMC card - drivers
 * 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 = {
static struct bus_type mmc_bus_type = {
	.name		= "mmc",
	.name		= "mmc",
	.dev_attrs	= mmc_dev_attrs,
	.dev_groups	= mmc_dev_groups,
	.match		= mmc_bus_match,
	.match		= mmc_bus_match,
	.uevent		= mmc_bus_uevent,
	.uevent		= mmc_bus_uevent,
	.probe		= mmc_bus_probe,
	.probe		= mmc_bus_probe,
+12 −9
Original line number Original line Diff line number Diff line
@@ -34,7 +34,8 @@ field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
									\
									\
	func = dev_to_sdio_func (dev);					\
	func = dev_to_sdio_func (dev);					\
	return sprintf (buf, format_string, func->field);		\
	return sprintf (buf, format_string, func->field);		\
}
}									\
static DEVICE_ATTR_RO(field)


sdio_config_attr(class, "0x%02x\n");
sdio_config_attr(class, "0x%02x\n");
sdio_config_attr(vendor, "0x%04x\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",
	return sprintf(buf, "sdio:c%02Xv%04Xd%04X\n",
			func->class, func->vendor, func->device);
			func->class, func->vendor, func->device);
}
}

static DEVICE_ATTR_RO(modalias);
static struct device_attribute sdio_dev_attrs[] = {

	__ATTR_RO(class),
static struct attribute *sdio_dev_attrs[] = {
	__ATTR_RO(vendor),
	&dev_attr_class.attr,
	__ATTR_RO(device),
	&dev_attr_vendor.attr,
	__ATTR_RO(modalias),
	&dev_attr_device.attr,
	__ATTR_NULL,
	&dev_attr_modalias.attr,
	NULL,
};
};
ATTRIBUTE_GROUPS(sdio_dev);


static const struct sdio_device_id *sdio_match_one(struct sdio_func *func,
static const struct sdio_device_id *sdio_match_one(struct sdio_func *func,
	const struct sdio_device_id *id)
	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 = {
static struct bus_type sdio_bus_type = {
	.name		= "sdio",
	.name		= "sdio",
	.dev_attrs	= sdio_dev_attrs,
	.dev_groups	= sdio_dev_groups,
	.match		= sdio_bus_match,
	.match		= sdio_bus_match,
	.uevent		= sdio_bus_uevent,
	.uevent		= sdio_bus_uevent,
	.probe		= sdio_bus_probe,
	.probe		= sdio_bus_probe,