Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1301592
| Path | csiph.com!news.freedyn.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Geliang Tang <geliangtang@163.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/3] driver core: bus: use to_subsys_private and to_device_private_bus |
| Date | Tue, 05 Jan 2016 16:10:03 +0100 |
| Message-ID | <qNBph-4ua-33@gated-at.bofh.it> (permalink) |
| References | <qNBph-4ua-31@gated-at.bofh.it> |
| X-Original-To | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=zq+500J/bL+p7/Xq40 fp5hRi+m7YJKQuQLqlX89HSoY=; b=dBQnPFBrifcPdYgpfS0MTSo7T+rlOrPj99 cBreKV/hT7zGeNYjAp2LwC8AcCVho9i6N1frVkJxHpKmP2NZQ46hs81l5StmeR+E SWKpHg1umzSqpWaKBTTHBNKmPyoEtzKJyt2ov2bDF7jdarWZmKB29G3/3m0/GsXp K6KNb8S94= |
| X-Mailer | git-send-email 2.5.0 |
| X-Cm-Transid | DdGowEBZh01Z24tWv+p8AA--.8296S3 |
| X-Coremail-Antispam | 1Uf129KBjvdXoWrKw1kGr1fur1ktr1DZFyDGFg_yoWDCFb_uw 1jv3Z7Wr4F9r1Ikw45Cr4fAFyFyay0qr9YvrZFqa93AFsrW3WY9rWDJr9xAr1Fgw4fKas8 Cr97Kr47Kr17GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xREknY3UUUUU== |
| X-Originating-IP | [116.77.129.183] |
| X-Cm-Senderinfo | 5jhoxtpqjwt0rj6rljoofrz/xtbByhzmmVO+g-jODAAAs9 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 39 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Geliang Tang <geliangtang@163.com>, linux-kernel@vger.kernel.org |
| X-Original-Date | Tue, 5 Jan 2016 23:03:38 +0800 |
| X-Original-Message-ID | <a26a49284b43f24bd28a34e7d0577bb8a61bbd72.1452006001.git.geliangtang@163.com> |
| X-Original-References | <446b40b7b494a2b06bbab6bfae7c2973affb0fcf.1452006001.git.geliangtang@163.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1301592 |
Show key headers only | View raw
Use to_subsys_private() and to_device_private_bus() instead of open-coding.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
drivers/base/bus.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 4bee6b0..6470eb8 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -149,8 +149,7 @@ EXPORT_SYMBOL_GPL(bus_remove_file);
static void bus_release(struct kobject *kobj)
{
- struct subsys_private *priv =
- container_of(kobj, typeof(*priv), subsys.kobj);
+ struct subsys_private *priv = to_subsys_private(kobj);
struct bus_type *bus = priv->bus;
kfree(priv);
@@ -1103,7 +1102,7 @@ struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter)
knode = klist_next(&iter->ki);
if (!knode)
return NULL;
- dev = container_of(knode, struct device_private, knode_bus)->device;
+ dev = to_device_private_bus(knode)->device;
if (!iter->type || iter->type == dev->type)
return dev;
}
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 1/3] driver core: bus: use list_for_each_entry* Geliang Tang <geliangtang@163.com> - 2016-01-05 16:10 +0100 [PATCH 3/3] driver core: bus: add a new helper to_driver_private_bus Geliang Tang <geliangtang@163.com> - 2016-01-05 16:10 +0100 [PATCH 2/3] driver core: bus: use to_subsys_private and to_device_private_bus Geliang Tang <geliangtang@163.com> - 2016-01-05 16:10 +0100
csiph-web