Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3162763pxu; Sun, 29 Nov 2020 17:23:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJylqHCxzhgsiS/cP/FrIjL8aRsQZGDn30grokrq/DyWy6PjtjDFhDoF5n7bDEKoV/8RRtZE X-Received: by 2002:a17:906:b14a:: with SMTP id bt10mr4561363ejb.458.1606699431710; Sun, 29 Nov 2020 17:23:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606699431; cv=none; d=google.com; s=arc-20160816; b=r5ZFeN3e68JBx2cNagBlPZ4Isi4H1nRLWCCyP+xg7yrJ30RJsGRnwQ5mFGBio9nuAQ hrnltWgRpOiPaJ1SVO9BfCueFrANgs+w8TyYYiOEl7USSzXbJu1I3weLIqDA9NbA7hWX OOfCswZuI12ca559E7HHRr1gE+u4ZDBa099Wyp8EinDYxNqpqXmhgMbQq/269Duny4O8 VeCvTDnbSzmwMhmJdCPuCwtFYTqXg7//4JAcQKEl/8YokOF/+P3CfwZbVKG3V2dqTqTR o7X2/3BkpBiXI46XnegD00s22h4SGYprBfhyUe+Wk03Jh0LA/lks7/TON5oygiNLYRED U5tQ== 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=NkTJEtuW3xW5ufxUMcur0/K14JZ0Glp7T4cK/tRE0xA=; b=uKHdVcYx0AJ4r+fsZyBUyDBboCYLlD6M/72oH5tR0h3W9sWbuC9PmtAPfr4o/O9ubu WChf6OaYFvYNCfSVUg/T9yEV7xs0WXJJA0TL9XhG1quWvNB59IayL/1AvTFsr/oE+12g ccF4RKjzPOCYWgiAwkh864Oj6QOXQJPKJPBa83AxLkmGqCpeGBtLKslpYq8Cen/m4xeF my3WCckSXvRASY/Y/FLSbMdS2MnUS02DxlGY+FDk/IMXMhjdpqWizpZ1WIInm5UExioF Fw8iJUVPgnDUmdXjPh+MVBR+OQEtgRtzELuEQAFJ+h/lfv7VqdtMyaKeJrG0HQFx4RK6 L7pw== 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 r17si10024573edp.395.2020.11.29.17.23.26; Sun, 29 Nov 2020 17:23:51 -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 S1727294AbgK3BTx (ORCPT + 99 others); Sun, 29 Nov 2020 20:19:53 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9069 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbgK3BTx (ORCPT ); Sun, 29 Nov 2020 20:19:53 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CknRz1yRZzLxCn; Mon, 30 Nov 2020 09:18:39 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Mon, 30 Nov 2020 09:19:09 +0800 From: Tian Tao To: , CC: , Subject: [PATCH] leds: lm3533: Switch to using the new API kobj_to_dev() Date: Mon, 30 Nov 2020 09:19:28 +0800 Message-ID: <1606699168-49894-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/leds/leds-lm3533.c:611:60-61: WARNING opportunity for kobj_to_dev(). Signed-off-by: Tian Tao --- drivers/leds/leds-lm3533.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-lm3533.c b/drivers/leds/leds-lm3533.c index b3edee7..9791166 100644 --- a/drivers/leds/leds-lm3533.c +++ b/drivers/leds/leds-lm3533.c @@ -608,7 +608,7 @@ static struct attribute *lm3533_led_attributes[] = { static umode_t lm3533_led_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct led_classdev *led_cdev = dev_get_drvdata(dev); struct lm3533_led *led = to_lm3533_led(led_cdev); umode_t mode = attr->mode; -- 2.7.4