Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp399375pxk; Sun, 30 Aug 2020 07:46:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvAAnw3fS7d+ALrhv9DSfE4I6QxbGqwMFuxbWFGGtK5sZUVPTCzHIKfg2dJgZTrdS34b54 X-Received: by 2002:a17:906:4f08:: with SMTP id t8mr8066979eju.164.1598798774445; Sun, 30 Aug 2020 07:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598798774; cv=none; d=google.com; s=arc-20160816; b=Mjs/wVsDm108WtrOCN2LmsD5hmzcL013ZtLvT247jHjI8ZaGrSRZXDPLWho+eehPV/ 62sJ/6LsiMNBpeVPpo1TSZUxFuVD3dKiJV2UlhkvLjBRwL3TR0/LxMSfAOP2ASZZtFSA JrmUyuEszc8cpQIQh6479KvguubOgs9H8bNU58JDVCsWFMaXIBMMRDfHKCTqr/LqLjlF Vt/f+LjVwbRRbbQ2rzpZ/fyynQ9KUaroBAvPQB0wL+b9gxdFsl/0AtdpHX1pi/JjM07Z GfU7itrpbcjUfIwr3WSX5KrZvt2ldv4IKCtLCz52ODnkFJWPbXV0oNZEj447XXlu9Q5o iNxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=t835k1LV75bF/p7yGDiAqwKpKLxEKCTqYo8kSWmJosQ=; b=j/ty0oz2oj7AgzWZDTVMb8o88MEQP8YzD/xicvNR3Aq2ehEMm0T3td5/XOm/Oyo5l/ PISAqTX+RkQV6S+aeTPuATpwONSVKJGZq0m4bRhu5BEQ8GjyD9RLwIbjO/VHIiOlK5aP 6Z59mgwN3hfbSSS8xaXqugPZEL2b+kJQOvPA31DCnza4q6pxGz4UNcL38JSZhUsE3DcZ co4mUlW9z5SVjgx4P9S0qPip90xgy+mOJsW2HCfJLCvAnIC7fXcDcabzUIZd4BH41Kts 8vECYDg4gSHX9ignpSRUVYWvrqhl/lu3mgNqadlW0Prybd2QKuiBaM6rE6v0NUSnPUtu IV+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ok21si3813340ejb.373.2020.08.30.07.45.52; Sun, 30 Aug 2020 07:46:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727883AbgH3Omj (ORCPT + 99 others); Sun, 30 Aug 2020 10:42:39 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:44862 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726928AbgH3OmE (ORCPT ); Sun, 30 Aug 2020 10:42:04 -0400 Received: by mail-lf1-f66.google.com with SMTP id 12so2102900lfb.11; Sun, 30 Aug 2020 07:42:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=t835k1LV75bF/p7yGDiAqwKpKLxEKCTqYo8kSWmJosQ=; b=JcIN868ambj6eshg95VTyxr8LR84DqFp+vyRSsGGYxaTRv2ML+V+/180CfNTBwRCfZ +tb05BniajotTXDh6Hff0oPydaRlmH+qbfNI1H/hkcUxru7MVGzh4NsETfvhzLP1N/dC G5U+7v95tN34ubYrZIH5Oi+8jkfHAF9dxOdzOO3gN/se7yNHfgc64w74Cv+6AWxfEgOV 40Uiiw318735xuR7nUk2mENrtpDBcb6gPVUnUArdc9cjKV1YyJkQooTPjFDpkl6JGUms 2yQF69fW4elTzyjDDeDkQNFFc7+XHe0p7bW8nOL7Ij1D6j3GzF7T5JmqqTpa3XZaGcfn mHZw== X-Gm-Message-State: AOAM531DUp46aJtrb+K6gTw3rVHjvgzaR6Bcy6mL7n+LpjJduT6Kp7t2 N+fDdNjewvRIyc4MmTSGW/E= X-Received: by 2002:a05:6512:10ce:: with SMTP id k14mr3666539lfg.7.1598798522069; Sun, 30 Aug 2020 07:42:02 -0700 (PDT) Received: from localhost.localdomain ([213.87.147.111]) by smtp.googlemail.com with ESMTPSA id h2sm1002466ljl.16.2020.08.30.07.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Aug 2020 07:42:01 -0700 (PDT) From: Denis Efremov To: Jonathan Corbet , Harry Wei Cc: Denis Efremov , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] docs: filesystems: replace to_dev() with kobj_to_dev() Date: Sun, 30 Aug 2020 17:41:35 +0300 Message-Id: <20200830144135.6956-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit a4232963757e ("driver-core: Move kobj_to_dev from genhd.h to device.h") introduced kobj_to_dev() function. Signed-off-by: Denis Efremov --- 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