Message ID | 20231025130737.2015468-7-gnstark@salutedevices.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2587092vqx; Wed, 25 Oct 2023 06:08:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiUX4iThdj/G1AgJzTnsfg92v97wNf+BtwRdn7XBdvD8CUPxO0/qL4cwBG8WC1zyyUF7lQ X-Received: by 2002:a05:6808:1985:b0:3ae:1298:257a with SMTP id bj5-20020a056808198500b003ae1298257amr18586284oib.1.1698239309494; Wed, 25 Oct 2023 06:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698239309; cv=none; d=google.com; s=arc-20160816; b=wyZhsYeXIAohB4EPBNcsb5wqXave6xjf1lraGgocFUqyEB8zKVqm7LYqXznnC4ONDU AsGaVEbTDmz/ebOpcOeZoaCLOhuW/vB9OBldcKG4KZVH6lMZSdbUfP4z5P1TDDOzBo3k /IksJ2+0pGCarvsYXVLrR45fNS2bTXZ4DBcqPe54rz4Tqs88HViM6qv2OwQ5DcdWUfOs nwbYs2u4m7ASX/DdKORnNq52purQXd1Q9LN748Dg9hTooNjxABEJgZEttqU5DG8z6Krm KCOMuzGujxew+d/QbrnXqXqgrDaEOGQ3z+uyMSpbOfKJ6P4N8ELUX7QhBZhxlUE9ggz8 yGMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=5E4909/OLVPw859bBxyrG8inInKJclLLjjZOJJt9bjw=; fh=TH/KyKkXF5LipyBG9stysnOYaFHGBRYytRmnm4H0CpA=; b=H8h1aU8/a6HmImq5gMyNzjAmSPeV9nLF5FzbwIl4V4g3RuKYF31AX0Laz7rIxxJ8L0 FMGfwMWZt27e4j42HCtz71d99kXdEJGcLoM20uKMA7nAcbJmNyV4Wv9s0OvBW3CK0Rc9 JF+U9dmSBwyAvyHOlhhYOscmDl1GOjPlr2ahQdPV0YmL3LtI5i2pzuQJ/19vIOt132Vt VbGwR6IE2yDDzgSjs2ynZ0Mh2aq95lgR/GecvSdVQ4YKCQjSlrVdBdFid6nLCwf4l6kr 39V6/YqeT8EviBnus7kbZZUnIyIMZcqDE52F5s38ZOJqBZBkZwHneIiP51UbVzO/umV5 Uupg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=D589SJVP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id w62-20020a25c741000000b00d9adea86ff6si10154255ybe.97.2023.10.25.06.08.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:08:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=D589SJVP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9FE878027892; Wed, 25 Oct 2023 06:08:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344383AbjJYNIG (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Wed, 25 Oct 2023 09:08:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344349AbjJYNHz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Oct 2023 09:07:55 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45B38116; Wed, 25 Oct 2023 06:07:53 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 6BBC1100048; Wed, 25 Oct 2023 16:07:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 6BBC1100048 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698239265; bh=5E4909/OLVPw859bBxyrG8inInKJclLLjjZOJJt9bjw=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=D589SJVPo+DoVMhZ7MkvVsSENwVznworXW7hjdcg9TVenGU9290jYzqO4IHkwkF5k aGLtT1R8Ft1vKB0csodWpzPsekDpgIDxttj78KJ2s0vDdIB00GkRQi1BH+0PKIiNj0 9ut1UVKmroXhApSzOWbXoycbrBkSUlMn0nzqL2N7K/1rSdxGjt4pNCcxqO77l5XlUO OCus4KY0+7z0PqhqXnnq6dSKVE24LF7W0Rjp8u8W12oqmQ65vOiFAEvWgre945hex7 AyUaYkTNS1VpmnjPtDBKrftuchF4jCEkqy2bE1SUpi06mA63eQuUHSNizjIxWZ7Yxu oLU1eMDftsPyw== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 25 Oct 2023 16:07:45 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 25 Oct 2023 16:07:45 +0300 From: George Stark <gnstark@salutedevices.com> To: <pavel@ucw.cz>, <lee@kernel.org>, <vadimp@nvidia.com>, <mpe@ellerman.id.au>, <npiggin@gmail.com>, <christophe.leroy@csgroup.eu>, <gnstark@salutedevices.com> CC: <linux-leds@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>, <kernel@sberdevices.ru> Subject: [PATCH 6/8] leds: aw2013: explicitly unregister LEDs at module's shutdown Date: Wed, 25 Oct 2023 16:07:35 +0300 Message-ID: <20231025130737.2015468-7-gnstark@salutedevices.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231025130737.2015468-1-gnstark@salutedevices.com> References: <20231025130737.2015468-1-gnstark@salutedevices.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180883 [Oct 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: gnstark@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/25 11:29:00 #22291710 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:08:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780732982269339636 X-GMAIL-MSGID: 1780732982269339636 |
Series |
devm_led_classdev_register() usage problem
|
|
Commit Message
George Stark
Oct. 25, 2023, 1:07 p.m. UTC
LEDs are registered using devm_led_classdev_register() and automatically
unregistered after module's remove(). led_classdev_unregister() calls
led_set_brightness() to turn off the LEDs and module's appropriate callback
uses resources those were destroyed already in module's remove().
So explicitly unregister LEDs at module shutdown.
Signed-off-by: George Stark <gnstark@salutedevices.com>
---
drivers/leds/leds-aw2013.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/leds/leds-aw2013.c b/drivers/leds/leds-aw2013.c index 59765640b70f..bd233500aa2d 100644 --- a/drivers/leds/leds-aw2013.c +++ b/drivers/leds/leds-aw2013.c @@ -404,6 +404,10 @@ static int aw2013_probe(struct i2c_client *client) static void aw2013_remove(struct i2c_client *client) { struct aw2013 *chip = i2c_get_clientdata(client); + int i; + + for (i = 0; i < chip->num_leds; i++) + devm_led_classdev_unregister(&client->dev, &chip->leds[i].cdev); aw2013_chip_disable(chip);