Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1846577pxu; Fri, 27 Nov 2020 17:24:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7/843tfLMv0EBy63akhsQCAXogquVPE/8U3Kggy0clpdW8Vz6Mcv4RjK27sS7NQFbqSOm X-Received: by 2002:a17:906:1c55:: with SMTP id l21mr10415771ejg.547.1606526698216; Fri, 27 Nov 2020 17:24:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606526698; cv=none; d=google.com; s=arc-20160816; b=yZ6q2XZUJN65RJWDOriMaE8/TggQCYIa78ewbKhQGwmkfJysBtW1SuxIz4mZl+PV7v y63fgSe+GfP5zs+K8LTcVA78PJzAQ8QjxT/lHfS9at61siMLKdiuj+POIqWdLM3sC7UL Bq/mz0SVBo9FoSfjvxKhfkkFrTwuAHt1fvl6B1eyNJ8gNbk/IhtQs1dlP1PIb+fEKB5a mjDfKrluXcJGo+4e6hVKzZJu1qHMeNtQgJvDYxNn/50Lc86URSqUiqP+sS2FHLQhba8Z J50eFz2JL4SywVdVsSe2X32cLsLP+xUehcJiQQOQsqMIw6uSVgVoZWqt61KmceSLiyv7 Nc4Q== 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=fKLoOPjuVVzclICXPqL1NMF+8DfVtxSS/2HgKHFc3eQ=; b=WaIuTLctXVM2vfY5RnFNU3Bv2xXewOHTUKGn/QIkUpetFB6SJuiUIJSFKqM8x1bSYe znoG2e6NFZdw6OIVz3KBfdDqHa+gAG1dmJPbXdKLL0rxLjFs4UtxOv5t9fDA1bYPpECp K3fENSe/8gBmqao+ygr+2sFBq7DlqUthhcjjFp8uZu78GSfb0nS6VGZLxEkqMlwQEAvq TWfvTN/FpQBHLJ3p9L91wHTBX6bcoD+1DzxxzIsOxj+Oro7Fsb6BR9nEWCfO6W9MB+sx ifJrMT1EcnyeyCxuCgFqPrySZc2+z5jOGctBzRia3cbJXxjFdbEDc5bcgDoaP+OS2pUE oG4g== 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 v7si6242706ede.343.2020.11.27.17.24.35; Fri, 27 Nov 2020 17:24:58 -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 S1731568AbgK1BCz (ORCPT + 99 others); Fri, 27 Nov 2020 20:02:55 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:8421 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731202AbgK1BAM (ORCPT ); Fri, 27 Nov 2020 20:00:12 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CjY6k2Ymjz73GH; Sat, 28 Nov 2020 08:59:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Sat, 28 Nov 2020 08:59:46 +0800 From: Tian Tao To: , , , , , , , , CC: , , Subject: [PATCH] hwmon: (pwm-fan): Switch to using the new API kobj_to_dev() Date: Sat, 28 Nov 2020 09:00:06 +0800 Message-ID: <1606525206-22154-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 fixed the following coccicheck: drivers/hwmon//pwm-fan.c:152:60-61: WARNING opportunity for kobj_to_dev(). Signed-off-by: Tian Tao --- drivers/hwmon/pwm-fan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c index 1f63807..7849011 100644 --- a/drivers/hwmon/pwm-fan.c +++ b/drivers/hwmon/pwm-fan.c @@ -149,7 +149,7 @@ static struct attribute *pwm_fan_attrs[] = { static umode_t pwm_fan_attrs_visible(struct kobject *kobj, struct attribute *a, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct pwm_fan_ctx *ctx = dev_get_drvdata(dev); /* Hide fan_input in case no interrupt is available */ -- 2.7.4