Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3223854pxb; Mon, 1 Mar 2021 05:00:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbGMDVP2ON3NjsOnTggaFnDC4WSgTvyPcvTgymvbRJwwTNXddSCap2V4Bz320ZkMe9qN1f X-Received: by 2002:a17:906:5295:: with SMTP id c21mr7386226ejm.67.1614603640774; Mon, 01 Mar 2021 05:00:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614603640; cv=none; d=google.com; s=arc-20160816; b=Elzq0BM8by22RbL8VAPcyoTYTYV03ZmJggo+pZBBEGixZbwE8th5rJ75V6uE3338xN 716UHraB9/1uTlc30p357h5dOb2SfdFOPWe94eZSeZ6nbFIuhHKRRkPMDdnWFrJrKLHr WvcdocGlsiar1sIoFCBFTOYf6Hrn+6lLr9wOJwx1Eu84A7iFbW0EEqVoBL1RfnFYg1dF XnVOcjfFYKGIbISpgpTDLLIbCgl4WIOdB9MYD1gWuZNBj1jt8gIVnMeAFRg8S6Wwv5eX BRo94+rv/XB4eTwpBNOtTdDZHdUp4BvyY0k1A1WYzSUx+uQxSh1HpW3hgSPyJqeEHseN /zbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=wllO1gZAEf/o/eQNcZQxwQwI1jNVFupQgNqepgxBKgg=; b=QrjOnCcY0icG1MlacLm3KZguHK+flK1WeAqMX98+TVhi69zI4CIp1C2SdeyNuEWRvE 2DoHpdTQiuZkIYUc0OlhVqwArjIUgFIcnQl2/B/+V9cCzvgYBTPl15eDXzKOO6Wp3vJO 5qTfDyjb2xKp72x7iOZhrkKmfYEZSwEkXI6tQVnGFdOSvnPmcTAsprM2Cj7Opcf7sDkY 4Xm3M5giYtvUWsqBC7mn5ZTrekUDs/GnIoDVIJc9QO1QKKkUBcqOxlxXrF0/6fpAxCHl k5uchkV69tbtglSIsggx6te8naL2mfNnZh3WGXCzqacoVfKMijm41hNEbR/DDbsa3XF8 KlPw== 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 o5si11437932ejm.1.2021.03.01.05.00.17; Mon, 01 Mar 2021 05:00:40 -0800 (PST) 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 S235193AbhCAM6z (ORCPT + 99 others); Mon, 1 Mar 2021 07:58:55 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:13101 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235203AbhCAM6x (ORCPT ); Mon, 1 Mar 2021 07:58:53 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Dq0d835Knz16F3Z; Mon, 1 Mar 2021 20:56:28 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Mon, 1 Mar 2021 20:58:05 +0800 From: Tian Tao To: , , CC: Subject: [PATCH] w1: ds2708 and ds2781 use the new API kobj_to_dev() Date: Mon, 1 Mar 2021 20:58:55 +0800 Message-ID: <1614603535-24046-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fix the below warnning: /drivers/w1/slaves/w1_ds2780.c:93:60-61: WARNING opportunity for kobj_to_dev() Signed-off-by: Tian Tao --- drivers/w1/slaves/w1_ds2780.c | 3 ++- drivers/w1/slaves/w1_ds2781.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/w1/slaves/w1_ds2780.c b/drivers/w1/slaves/w1_ds2780.c index c281fe5..3cde1bb 100644 --- a/drivers/w1/slaves/w1_ds2780.c +++ b/drivers/w1/slaves/w1_ds2780.c @@ -90,7 +90,8 @@ static ssize_t w1_slave_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); + return w1_ds2780_io(dev, buf, off, count, 0); } diff --git a/drivers/w1/slaves/w1_ds2781.c b/drivers/w1/slaves/w1_ds2781.c index f0d393a..2cb7c02 100644 --- a/drivers/w1/slaves/w1_ds2781.c +++ b/drivers/w1/slaves/w1_ds2781.c @@ -87,7 +87,7 @@ static ssize_t w1_slave_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); return w1_ds2781_io(dev, buf, off, count, 0); } -- 2.7.4