linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: filesystems: replace to_dev() with kobj_to_dev()
@ 2020-08-30 14:41 Denis Efremov
  2020-09-09 17:36 ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Efremov @ 2020-08-30 14:41 UTC (permalink / raw)
  To: Jonathan Corbet, Harry Wei; +Cc: Denis Efremov, linux-doc, linux-kernel

Commit a4232963757e ("driver-core: Move kobj_to_dev from genhd.h to device.h")
introduced kobj_to_dev() function.

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 Documentation/filesystems/sysfs.rst                    | 3 +--
 Documentation/translations/zh_CN/filesystems/sysfs.txt | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Documentation/filesystems/sysfs.rst b/Documentation/filesystems/sysfs.rst
index ab0f7795792b..5a3209a4cebf 100644
--- a/Documentation/filesystems/sysfs.rst
+++ b/Documentation/filesystems/sysfs.rst
@@ -172,14 +172,13 @@ calls the associated methods.
 
 To illustrate::
 
-    #define to_dev(obj) container_of(obj, struct device, kobj)
     #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
 
     static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
 				char *buf)
     {
 	    struct device_attribute *dev_attr = to_dev_attr(attr);
-	    struct device *dev = to_dev(kobj);
+	    struct device *dev = kobj_to_dev(kobj);
 	    ssize_t ret = -EIO;
 
 	    if (dev_attr->show)
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 9481e3ed2a06..046cc1d52058 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -154,14 +154,13 @@ sysfs 会为这个类型调用适当的方法。当一个文件被读写时,
 
 示例:
 
-#define to_dev(obj) container_of(obj, struct device, kobj)
 #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
 
 static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
                              char *buf)
 {
         struct device_attribute *dev_attr = to_dev_attr(attr);
-        struct device *dev = to_dev(kobj);
+        struct device *dev = kobj_to_dev(kobj);
         ssize_t ret = -EIO;
 
         if (dev_attr->show)
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] docs: filesystems: replace to_dev() with kobj_to_dev()
  2020-08-30 14:41 [PATCH] docs: filesystems: replace to_dev() with kobj_to_dev() Denis Efremov
@ 2020-09-09 17:36 ` Jonathan Corbet
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2020-09-09 17:36 UTC (permalink / raw)
  To: Denis Efremov; +Cc: Harry Wei, linux-doc, linux-kernel

On Sun, 30 Aug 2020 17:41:35 +0300
Denis Efremov <efremov@linux.com> wrote:

> Commit a4232963757e ("driver-core: Move kobj_to_dev from genhd.h to device.h")
> introduced kobj_to_dev() function.
> 
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  Documentation/filesystems/sysfs.rst                    | 3 +--
>  Documentation/translations/zh_CN/filesystems/sysfs.txt | 3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/filesystems/sysfs.rst b/Documentation/filesystems/sysfs.rst
> index ab0f7795792b..5a3209a4cebf 100644
> --- a/Documentation/filesystems/sysfs.rst
> +++ b/Documentation/filesystems/sysfs.rst
> @@ -172,14 +172,13 @@ calls the associated methods.
>  
>  To illustrate::
>  
> -    #define to_dev(obj) container_of(obj, struct device, kobj)
>      #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
>  
>      static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
>  				char *buf)
>      {
>  	    struct device_attribute *dev_attr = to_dev_attr(attr);
> -	    struct device *dev = to_dev(kobj);
> +	    struct device *dev = kobj_to_dev(kobj);
>  	    ssize_t ret = -EIO;

Applied, thanks.

jon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-09 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-30 14:41 [PATCH] docs: filesystems: replace to_dev() with kobj_to_dev() Denis Efremov
2020-09-09 17:36 ` Jonathan Corbet

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).