From patchwork Wed Oct 25 13:07:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Stark X-Patchwork-Id: 158071 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2586962vqx; Wed, 25 Oct 2023 06:08:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHt1liOg5cm6G7F/Ghe+RDSSr3m/R43eMtSt9vluokODTu5PvrcIWb3bZVsXFzap+t9LLkj X-Received: by 2002:a5b:710:0:b0:da0:514a:8f42 with SMTP id g16-20020a5b0710000000b00da0514a8f42mr4421711ybq.32.1698239301013; Wed, 25 Oct 2023 06:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698239300; cv=none; d=google.com; s=arc-20160816; b=tC+vc85YU0rPmQdIdnorPqKZ90hIfWl5KvY1baLPIcrPSorLg+Nn5bvmi1HjH2CdG3 4/qtLQR744pzciHNJ192rIXLr7mOppII3FRCC84sr9CJvvtj2Q46bMbA1B07uuMax2x3 m2EpTyg7wSGgbH2Y88Qyp/qq4+WAZpaA2kozo6UlAAO/cR0bJZsO2WPOe5+Ta68K3EwB gWWiLNuufbn2K/LoeGsUp8+rLn6BXaeWYeNu3egEa07mT/9vNmzXJpD0d2J4XTaPk6mC B0I94y4ZysstJaAdMcasqAZ8JeoDsbTf64TZ+8xMbPXxnPAWLvnViMXDkkwIjLEobe4r gUEg== 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=QI0eEMit4cRAk0dzmRcmJgiC5EDe0H7Kqy7+mSGTVrU=; fh=TH/KyKkXF5LipyBG9stysnOYaFHGBRYytRmnm4H0CpA=; b=IEqq/ot5lKPEERnyBR3DNcHz5XEpwdODNIt07Ae9JquJuSBmhyGVKcWaSvitTjM5ws 2MaYaMCkF3aCFf0R3UnYnNdEtGSHvKCj/UOGJSrrX6PYKnEB9shqesfFAtRHvLipfkks V2/S/WtuzQAtNsFWBED5Mw6l8Qwlf1B2Wt4EW0eQQtCtPZAWcbtivgxXnzlGeoNQaQ5K FGGTYt5EDW8YUEsBWtrtTC3LHI25HX8V5cgFY5bFoiMJzXluXn2vdUKXfsZ4sLNjiEF+ CFQOTiFFLf+WY4E8V5VGAvTbpCn52+bzmn9DavpHfyyxgqr4Q5XluRZid7qqxFCo4vqf E4rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=EmYuRvSh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x67-20020a25a049000000b00d800da62efcsi10728350ybh.63.2023.10.25.06.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:08:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=EmYuRvSh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id D508B80FA9C6; Wed, 25 Oct 2023 06:08:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234963AbjJYNIC (ORCPT + 26 others); Wed, 25 Oct 2023 09:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234926AbjJYNHx (ORCPT ); Wed, 25 Oct 2023 09:07:53 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B5BC130; Wed, 25 Oct 2023 06:07:48 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 8E872100043; Wed, 25 Oct 2023 16:07:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 8E872100043 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698239264; bh=QI0eEMit4cRAk0dzmRcmJgiC5EDe0H7Kqy7+mSGTVrU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=EmYuRvSh8MROTQg+CWmVIV3ikaw4wqLxA7YespJ51Vt90wv4OJBBVdF+A5bM2O+Ba xt2+No1w8iIhvvbU5n2TEQAIQYAcJMnAhYhjOx9JLMTz+KvRmWNDTkFhsIVeHS15FX kFcvkjVZyJdhPO7MLDC+1DlRcdY/ab9UH9b07OjAxJzT7FcihnWqKC7njeuiOZiu0s dGG9otRgt3xpTKhii8rk7Hf5c2WpFtWR7RloZynI1NYjVRB0QniDtYs6JssC4m75SN DP+ROqDLgC3vJW3qJrzHnHAvhngpAEgcn8eKIZ5x08gylzWBzvkkVv713uOWrfqwHr Z1G9FXd3eeORw== 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:44 +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:44 +0300 From: George Stark To: , , , , , , CC: , , , Subject: [PATCH 1/8] leds: powernv: explicitly unregister LEDs at module's shutdown Date: Wed, 25 Oct 2023 16:07:30 +0300 Message-ID: <20231025130737.2015468-2-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 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:08:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780732973036905392 X-GMAIL-MSGID: 1780732973036905392 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 --- drivers/leds/leds-powernv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/leds/leds-powernv.c b/drivers/leds/leds-powernv.c index 743e2cdd0891..7c7f696c8265 100644 --- a/drivers/leds/leds-powernv.c +++ b/drivers/leds/leds-powernv.c @@ -302,7 +302,12 @@ static int powernv_led_probe(struct platform_device *pdev) platform_set_drvdata(pdev, powernv_led_common); + if (!devres_open_group(&pdev->dev, priv, GFP_KERNEL)) + return -ENOMEM; + rc = powernv_led_classdev(pdev, led_node, powernv_led_common); + if (rc) + devres_remove_group(dev, priv); out: of_node_put(led_node); return rc; @@ -313,6 +318,8 @@ static int powernv_led_remove(struct platform_device *pdev) { struct powernv_led_common *powernv_led_common; + devres_release_group(&pdev->dev, powernv_led_common); + /* Disable LED operation */ powernv_led_common = platform_get_drvdata(pdev); powernv_led_common->led_disabled = true; From patchwork Wed Oct 25 13:07:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Stark X-Patchwork-Id: 158072 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2586966vqx; Wed, 25 Oct 2023 06:08:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFB9GmicoYZk1wZ1xKFN1lhHe4Zn0TApKZrC6KxO7KPLpp46f0MNDseCejItFDIXk/spnQA X-Received: by 2002:a05:6808:17a3:b0:3b2:e3b5:b94 with SMTP id bg35-20020a05680817a300b003b2e3b50b94mr18958404oib.16.1698239301166; Wed, 25 Oct 2023 06:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698239301; cv=none; d=google.com; s=arc-20160816; b=ElPRLqko8KKgaOl9VJo3IDWvUfvHgyP77HTUdYs+ksdpUeQdMctnQTOCJPouvatR9A RIHmSRk+fSerShTfW2VdNqJX5R4uvgJI1gVY6QGgqkHYc+Bv7c/Fg7zI6D4OD5UKgfM1 8CiOsGcoP/qRvz1ElPhXzMUDnE9eSB/DYglD+Dsf0VMsQDOWpzGXTES6q4KjsmvvuRh6 m+kNfPxebJCu9+HyEP31NK4ReMgX2qgo7AUyJ+Smmuc7oSfF49AWdxwgqEJ1RICY5+TF qXXkyXGN+5xJqWMmVexmdlutHC7JtfhtDYOUETasj9M6a2bDWRBAKNEiSZV+X/YNrDfe BfKg== 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=bfmNKLq7qXt685RQkGWfdj7Fq3sNLbKBr4vZ23mFyMU=; fh=TH/KyKkXF5LipyBG9stysnOYaFHGBRYytRmnm4H0CpA=; b=pgYGl6nPzNBexnk9onPT2eZVhKH+p8O5yFn92hvfaRzgbgAFpBgu+76rzANpr8AeeN /GsUUcmz9cRPaR3i/7SrH9EI2QkKX0V4WZwr2lzP51o85Kb9WreujvzrZgcK8L2YwiWM Y7GFZz+bvCCc6gYlUfA+2D7YTY3itJ2bZsbUDno4ct3SJnQ2wA/9RddXPpZni+m9zSQX 5/oym1eMAZG/vSmq5JyZqU2rm587MOyGHVSqCsmBXsY8KSuBCrFGZQnyonrr5AIPJk5H g5Wj15i9w51HgwM9+k+PwEhbwZzzRgloC4L5KsHrDzKCZ4UsfE6sV4aW4KakqaQRZ3nQ /jgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=VojGS1Pp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id x23-20020a25acd7000000b00d86a6df0615si11140589ybd.730.2023.10.25.06.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:08:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=VojGS1Pp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 547D0801DA05; Wed, 25 Oct 2023 06:08:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344318AbjJYNHy (ORCPT + 26 others); Wed, 25 Oct 2023 09:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234066AbjJYNHx (ORCPT ); Wed, 25 Oct 2023 09:07:53 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85E9412F; Wed, 25 Oct 2023 06:07:47 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id B5F61100044; Wed, 25 Oct 2023 16:07:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru B5F61100044 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698239264; bh=bfmNKLq7qXt685RQkGWfdj7Fq3sNLbKBr4vZ23mFyMU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=VojGS1PppsDkwWGmglY1Afhu5vYAKIYEUkEHdbS8F1mzDQmnEWIJJKLEu5ge1jdKk jz9GjXWVhsKYUqVgkk6ZU7SYg50fwdfLaZXmNuSgalrOibjjfWCRjsm5h3w79k5g+K FkHvvweEIoiTlvnLeuBmY15fp2mg/5t0cZjCIGg1P5myRI1ECi7Tk1xgdjgZfMqet9 +BMue/7yrY0AhX84Oeroa+AVJdiOZXgAkAfkkqDrom4iyT3QHAc5ZKlvXVgulumCHC uq87G1cFwo3PxrvrAITB6YhIM4rzluhSPzcX0+N8HSBESMawpUffI+Vl6R/xHdP+/C ztSeq+Vm0XV5Q== 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:44 +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:44 +0300 From: George Stark To: , , , , , , CC: , , , Subject: [PATCH 2/8] leds: nic78bx: explicitly unregister LEDs at module's shutdown Date: Wed, 25 Oct 2023 16:07:31 +0300 Message-ID: <20231025130737.2015468-3-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 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 pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:08:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780732973782438485 X-GMAIL-MSGID: 1780732973782438485 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 --- drivers/leds/leds-nic78bx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/leds/leds-nic78bx.c b/drivers/leds/leds-nic78bx.c index f196f52eec1e..12b70fcad37f 100644 --- a/drivers/leds/leds-nic78bx.c +++ b/drivers/leds/leds-nic78bx.c @@ -170,6 +170,10 @@ static int nic78bx_probe(struct platform_device *pdev) static int nic78bx_remove(struct platform_device *pdev) { struct nic78bx_led_data *led_data = platform_get_drvdata(pdev); + int i; + + for (i = 0; i < ARRAY_SIZE(nic78bx_leds); i++) + devm_led_classdev_unregister(&pdev->dev, &nic78bx_leds[i].cdev); /* Lock LED register */ outb(NIC78BX_LOCK_VALUE, From patchwork Wed Oct 25 13:07:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Stark X-Patchwork-Id: 158073 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2587084vqx; Wed, 25 Oct 2023 06:08:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKZjzahZxTQKbAvM/AtnzpOhI/PWg+NVxQ7KocOCyvW293nieXxygbIP9SWNhlxRmAI8SZ X-Received: by 2002:a25:3489:0:b0:d7a:d716:233c with SMTP id b131-20020a253489000000b00d7ad716233cmr14377680yba.41.1698239309100; 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=xz9XyZD16koWwSxMmj2nhmHUrjOzUSQxi0C/A3haYPRKIZ1FrM/GxmqIKgHmLx2efK spqR/1uCDvSMvzZ5A8HP/bI5nbsvnZFQupK4M4frI/nGG8+jBH1orTyQaQmsL/yKpVZ+ rUxgOOA8Ui8WKzm/VUv/rg9rOBzBYMXSRjVhXn8PGpyAQZxBxbz83rMXEC0Cg192wEsI R/1Rah8biByAT/4UcB0Sr70oQ7/k3hcPNNk9dTqo6i4ewzec2KpVic1hiI7+tEHR5ySe 9LcssrV1S2THScRtQsfOHafPaHnnInLVnARYOcbNT0wp3Nn9HXUkBTiugiZYAL01chmm AfUg== 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=X7h6QnvXdm+wS50Idwxv0nNdXJ9bCTp96VnMyQNCCwg=; fh=TH/KyKkXF5LipyBG9stysnOYaFHGBRYytRmnm4H0CpA=; b=z174fAMZDH2FUIju8BPDlHwjWZGlsJUQ1udzd8U4UFV2PzCLlW5kISitJsJzM6303o WxwGqF5JQ76hhtNwu5l+uW5lwHSi3RPMueuxs7gUDOLwWgE6JEdpP0JPRbqshRg4g2J5 XqMLLbnjVkpGuSLz6TqWGX1wlij69uKAK+HXr9jnPmR4tMA9NmWTTg8m4zrNpRLAT04n 9PER2vKkpj2fDosE6jOJEqyCYfTICT4A6GGvO4UDIneskGWJ6kZQ+xSZIjgfj5eiqXmx idnx4sEcQMofQyhGMBYa8EBZ8RCgftAb4RUW3RNUcSSzhsC9ShonIwWihv2RDf15cHJ8 5fnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=ZZ1auFEM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id p20-20020a257414000000b00d9a3596a13csi10641796ybc.100.2023.10.25.06.08.24 (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.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=ZZ1auFEM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 52FCF80202FB; Wed, 25 Oct 2023 06:08:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344370AbjJYNHz (ORCPT + 26 others); Wed, 25 Oct 2023 09:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233837AbjJYNHx (ORCPT ); Wed, 25 Oct 2023 09:07:53 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70D2F111; Wed, 25 Oct 2023 06:07:47 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id DF1B0100045; Wed, 25 Oct 2023 16:07:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru DF1B0100045 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698239264; bh=X7h6QnvXdm+wS50Idwxv0nNdXJ9bCTp96VnMyQNCCwg=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=ZZ1auFEMuagcIDSYOZM/p5o94oG1+t8GC7IJ14Leiu0ddlm09XDkHDT3TgDXNQ00q XOLfr/sfvTfSzhqe8LZwosH/6Q6VrYqXH/o2mZT/rnaUi51g0pdkx9oncCeHeFQFEz BgLrj2isnzciMZFHXWL+qQMrGstMnQnT0eG1B32GvApOH47JEHQnBvleUyUVan2XUH 6nkEpdI9Qx3KEYgpUqBIFtLZyeLS2fMReyNVPP5IwWgmkuediQZHa+k0s44PqvSGK4 2m4j3UQDR3nqY6WRjdqSM7W9+XAiRfoAdXRNgwbijhbg4sYDOWHznKjCAW7B0csw1z fXEjPXLAQDgOw== 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:44 +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:44 +0300 From: George Stark To: , , , , , , CC: , , , Subject: [PATCH 3/8] leds: an30259a: explicitly unregister LEDs at module's shutdown Date: Wed, 25 Oct 2023 16:07:32 +0300 Message-ID: <20231025130737.2015468-4-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 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 pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:08:18 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780732981472267564 X-GMAIL-MSGID: 1780732981472267564 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 --- drivers/leds/leds-an30259a.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/leds/leds-an30259a.c b/drivers/leds/leds-an30259a.c index 24b1041213c2..4209a407d802 100644 --- a/drivers/leds/leds-an30259a.c +++ b/drivers/leds/leds-an30259a.c @@ -324,6 +324,10 @@ static int an30259a_probe(struct i2c_client *client) static void an30259a_remove(struct i2c_client *client) { struct an30259a *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); mutex_destroy(&chip->mutex); } From patchwork Wed Oct 25 13:07:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Stark X-Patchwork-Id: 158070 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2586696vqx; Wed, 25 Oct 2023 06:08:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDtTMzrbST0lNoSn60+4Tvl3ScvecaQXkYaMQYvvas9l/DXgtKicILipetA1EvrcBjQn68 X-Received: by 2002:a81:d442:0:b0:5a7:fcae:f3e2 with SMTP id g2-20020a81d442000000b005a7fcaef3e2mr15901676ywl.43.1698239293959; Wed, 25 Oct 2023 06:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698239293; cv=none; d=google.com; s=arc-20160816; b=ASe78uiXG1ToqT7+Nt66nSGTQnHFvcQXaskQz9frv/JJ3s4s62Yu44izMxYAi+K/VY zYhVFd1zUrg8r53qt0id/bfFI61vulLoFdwxwv+77UGVFIRN2odb+WXX2HTINhr9FtuG U3W2yK1LJikqW/nqkWs+MW6vznXKtpiYoTF3Y+jhHK5OfR6EZlcT8/sVh+fVwmdC1x5G 4724WZU7ou8XCsic1mns8kx0JvRYnegOsXkcO2RutcNzp44eVBpGKbBDqZorOIFJIhsc YAojVx6Srgw68gLrhRgyy3lkrouyZHzOPkvMQ5PAizELd6OrSgJd/3TAF/rmY2QS139C Ipbg== 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=0EQMoFRrUMx/pZxHfkfAMtFPBkQrssL7XqzVKbD+szU=; fh=TH/KyKkXF5LipyBG9stysnOYaFHGBRYytRmnm4H0CpA=; b=tM84a/JCv6ww1XOCYNGKaAuFozo/mHUCRu9ldzBlSUbYIrUyp3wsvy/GPwIi9h6X76 Pz0+4nwrGPvxvaLTT3VSlDpgccyonWwmY9rTlrOkUsPCpATSZJ9moKFsVionGoZ8hGaR YqVwA1fxSN+MdApzINMlNmF8cOcJGseLjAKcYpAw6jx1RApKPlETeVUvU6HZs4Xj4K8G hIllKzKRFWQWB2pKBIFiqd7szgHqb8IYUeocfBsfYeAQMTS/v7VukpeXQDLJfDzFXQRb Ax4e4YLucjL1Ueva5Nf9TgAm+U4K+UU8TK9Jcl1KoVta6ugz0HK6lKPDgsQ5fArHuqrU T0qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=vx7Mcugj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id n15-20020a819e4f000000b005a24baabc69si10949265ywj.409.2023.10.25.06.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:08:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=vx7Mcugj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id B5C0F80FA872; Wed, 25 Oct 2023 06:08:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344384AbjJYNH5 (ORCPT + 26 others); Wed, 25 Oct 2023 09:07:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234947AbjJYNHx (ORCPT ); Wed, 25 Oct 2023 09:07:53 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10F9E131; Wed, 25 Oct 2023 06:07:48 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 1626E100046; Wed, 25 Oct 2023 16:07:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 1626E100046 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698239265; bh=0EQMoFRrUMx/pZxHfkfAMtFPBkQrssL7XqzVKbD+szU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=vx7Mcugj3I9S9uBn5rE9V5gZRQf8CUYDa9cbpn7gaCtackskccpRqqVw0zcmZ3QOS 0zraMsyawXa63Eg83alOBOoAtLHB1PkWXAjhXzNHVl+1Q0HEIJYffeuEfMuQSo5jtN jyg+rx5GyBPaiwkC7GhYzrbG1CYRymgrWqSufJ72/P5JccGdqk4gbd5JBmOj85byQi 8RWoH1dl+oNkX1MVLlDNk9a++QarZSRWb97vGp8eL9Pi8Etletswgf3DWNzMxv3RCi 7d9NkNYGklHunkQY0Krex0ADtCfcboiJIwI5CzBDrQGNb0bOPN2OjKMJshjUCvloLw wKoGthGQ0y5vA== 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:44 +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:44 +0300 From: George Stark To: , , , , , , CC: , , , Subject: [PATCH 4/8] leds: mlxreg: explicitly unregister LEDs at module's shutdown Date: Wed, 25 Oct 2023 16:07:33 +0300 Message-ID: <20231025130737.2015468-5-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 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:08:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780732965613943241 X-GMAIL-MSGID: 1780732965613943241 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 --- drivers/leds/leds-mlxreg.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c index b7855c93bd72..6d65e39c3372 100644 --- a/drivers/leds/leds-mlxreg.c +++ b/drivers/leds/leds-mlxreg.c @@ -258,6 +258,7 @@ static int mlxreg_led_probe(struct platform_device *pdev) { struct mlxreg_core_platform_data *led_pdata; struct mlxreg_led_priv_data *priv; + int res; led_pdata = dev_get_platdata(&pdev->dev); if (!led_pdata) { @@ -273,13 +274,22 @@ static int mlxreg_led_probe(struct platform_device *pdev) priv->pdev = pdev; priv->pdata = led_pdata; - return mlxreg_led_config(priv); + if (!devres_open_group(&pdev->dev, priv, GFP_KERNEL)) + return -ENOMEM; + + res = mlxreg_led_config(priv); + if (res) + devres_remove_group(&pdev->dev, priv); + + return res; } static int mlxreg_led_remove(struct platform_device *pdev) { struct mlxreg_led_priv_data *priv = dev_get_drvdata(&pdev->dev); + devres_release_group(&pdev->dev, priv); + mutex_destroy(&priv->access_lock); return 0; From patchwork Wed Oct 25 13:07:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Stark X-Patchwork-Id: 158075 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2587138vqx; Wed, 25 Oct 2023 06:08:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH70ZWMMXD0pARwhjUgGOO+9gxw4y6ridYjLhhD3I9goAMBd0GXcJK3iBHL6pxlZdaEA9MY X-Received: by 2002:a0d:e643:0:b0:5a7:aa65:c536 with SMTP id p64-20020a0de643000000b005a7aa65c536mr16038135ywe.0.1698239312259; Wed, 25 Oct 2023 06:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698239312; cv=none; d=google.com; s=arc-20160816; b=GsnyvbIQw9t79kSJfitSfX6Xwav3Q2CB5BLEHRCMjvs3r6du3P0bMEco7zlXngxc3f W061dpv8XSqeItWIwvBlGLebz1A0MsRierNL1WR8M3eyr3TUF9PMBX9S5fH+tD3xsnA7 vQfiXDI/7sWbNPc0fFzOY7RMOlJam8sK8OBikycEFd+MM+YlgeJnmCZ60AO1BZibkRSW buNe6AtftTrK9x0eE83eGe/QG//Jc8voijSgZozTi9unTsEk9VjpOKmL23j3vryR3dVo 8wVwaxXNCKHzFD/Bm2HT9CPYXfQj+r5lzWtmf+rq1+gxdnnjf4gcT/EP+ey6OFdefPx9 S0tw== 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=oixfku0w9a55w5ewxmzKyEa0rIk5Ii9elJB6GpE/4So=; fh=TH/KyKkXF5LipyBG9stysnOYaFHGBRYytRmnm4H0CpA=; b=w/4g4Rfn/uuyyCnNyONaLC68gvZsgGP5EcYTEI2ymRJeiDHrhA9qqKp25MTCze1O5D +RuBnYYiSmqVPLZ7xRkRQme5D3EDQ7T/r2rZgo/z5e2Nt2/opqg5528E/HH0engV9HD0 Y2zQ16c1N8mQVji2zCO+GjcnkAYutBacoLStbN684tYEqzBzGgO4V1Lqz3CgYRUauyjz lG5ffu/vb+ISlhvFaHvYxJa9d7O0xasyC7ShTMFM/3K4mfNXDagqZu351fHqnrhYEb+/ cZc7buXk6q2yAbfppEylLaytViWDId7BmeXhO6TC6LKFyxNUJg2xbdF5eY4QJf/sx1dM zT3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=JTTgkKt0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id r7-20020a818107000000b00592620eba39si11509278ywf.448.2023.10.25.06.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:08:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=JTTgkKt0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 84F6B80FA9E0; Wed, 25 Oct 2023 06:08:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234998AbjJYNIK (ORCPT + 26 others); Wed, 25 Oct 2023 09:08:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344347AbjJYNHz (ORCPT ); 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 24DF5111; 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 41D8F100047; Wed, 25 Oct 2023 16:07:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 41D8F100047 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698239265; bh=oixfku0w9a55w5ewxmzKyEa0rIk5Ii9elJB6GpE/4So=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=JTTgkKt0p6xO4qtz6WSKRWy/EAKHEVUbJHuYRMIpW/u5mzRvw+5YeQrApya0AzjYE 673HGNkA9lOnam9JcG4sHvTC3NfQnBIrqdWpXnxKqIzr3obiYJ5VEEJcuCrWtamRnW nNq1qiE8ecwC3g24VScn4jGdkTozEIV7ZjE//RvEf18vg17uq4opxfKCUpejcsiZgW Odly5/PkftjP7/H2XUrsp7/+DNvRlPsn0948dHMzrhFlpLDZ7GlQlCpviPcfZB8fGX iS79uDOHdGwL6IDzc/cIgztEYi2LEXwH/GRuA4zmJSGThQcFfybuW2Q4hTLx3KSvhK yXRG75zTfFupg== 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:44 +0300 From: George Stark To: , , , , , , CC: , , , Subject: [PATCH 5/8] leds: aw200xx: explicitly unregister LEDs at module's shutdown Date: Wed, 25 Oct 2023 16:07:34 +0300 Message-ID: <20231025130737.2015468-6-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 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:08:17 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780732985215922259 X-GMAIL-MSGID: 1780732985215922259 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 --- drivers/leds/leds-aw200xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 96979b8e09b7..3da0923507ec 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -539,6 +539,10 @@ static int aw200xx_probe(struct i2c_client *client) static void aw200xx_remove(struct i2c_client *client) { struct aw200xx *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); aw200xx_chip_reset(chip); mutex_destroy(&chip->mutex); From patchwork Wed Oct 25 13:07:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Stark X-Patchwork-Id: 158074 Return-Path: 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 + 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 ); 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 To: , , , , , , CC: , , , 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 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: 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 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 --- 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); From patchwork Wed Oct 25 13:07:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Stark X-Patchwork-Id: 158076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2587139vqx; Wed, 25 Oct 2023 06:08:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgT0x/+nAC+aI8ieMIdX0I1Kk10VfJi1S9dcDRNnwu7wl2hrEoWdoAt6KAa5I3wz9mqThI X-Received: by 2002:a05:690c:38b:b0:59f:7650:8fdb with SMTP id bh11-20020a05690c038b00b0059f76508fdbmr18949288ywb.33.1698239312222; Wed, 25 Oct 2023 06:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698239312; cv=none; d=google.com; s=arc-20160816; b=SgE4H75fjBWDqCyNCrGv0clqMOHnuZMtSS11+UpUbwkFTwOFHi2qGFv7QCcsETQ+2m KGMFjIPKhoAybp7/k/B6kbg9sW1kDK4C1bR/hYbhgL+3nWZspaeEETj+fw2S6qu6HZ3O ouLfd/qMI93S91VEU5yZiaro2yvWLBEIQc9XlUt21kgT3TjDAL4wlzZV9m77AAKjtO4B +8NbAlMysb4dEklU7acN7kb1UPArvJJSP+YrWh8ImrIOoopSVErJvi/AUX5Ud9f1E80S VYg2GmsQk1ayX1d5LeorIwi082O0yIkR95yyBSViFUJZiZ3IQP1ySCG2TwfKykAlRqnb 1hOQ== 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=jFv3zRFPBURbWkj0WPqDbxM+2lb+aTaY7naFpHwUmqk=; fh=TH/KyKkXF5LipyBG9stysnOYaFHGBRYytRmnm4H0CpA=; b=LDKB5vrGUf5DJNl+ibQkEonnANpt1atW5Asqwf5PENqtC/ARLzBr1/NinOsTaXgqse kwbivLZsjIyb5j3y0PyHO7lG+lD/xS8cjcoMLo1k/+i3ZYFOeu90+bfz8h3UM/tIp+Ve Nd9IUZuxpRqsDCgqWxu6tlcOmwHmkfRduKfNp5hXTRTUa3r0rtp+19kG2Jq5t8660Lly /d18Xj/RN0ac44Z1gbca0dsHWuFNPGArjANuKciOxdleEF3gsrOCArazHSn8i0SNEjys 2eX6bBLdOs55CmYNNpqN0XYoJX84kIMUToWQ99Y12u9Ttx0Fr4lLMjjbzMpIaVnDGeZG 3azw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=QZ+3oERQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id da21-20020a05690c0d9500b005abbe8f3a35si8785855ywb.252.2023.10.25.06.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:08:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=QZ+3oERQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 1B45A80DAC69; Wed, 25 Oct 2023 06:08:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344422AbjJYNIN (ORCPT + 26 others); Wed, 25 Oct 2023 09:08:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344372AbjJYNHz (ORCPT ); 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 B258312F; 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 944F5100049; Wed, 25 Oct 2023 16:07:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 944F5100049 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698239265; bh=jFv3zRFPBURbWkj0WPqDbxM+2lb+aTaY7naFpHwUmqk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=QZ+3oERQ60BbSQDRTDDg7BpzHN8Yp2ggrHeGmuqVl2QEa2Pfof8BoyVWfiw8d2Qom dhnZcGc32wNXr9vLV2cJbFbBB2TTOOzOs73qH/+jKsItMuNNljqwFuBse0AjkwpjzZ 2qAwHq5+fqeqUvlCSwdlnq9ftxnwq4mV6Mugvxk7hqOhas3UK4zD7Ve+H6ws/z1Pum kptVRCooRp4TWSqzLsJjBRYjMcvv6tz8ntzUKJ9XMAmxFU6aHCPFVuBzCSHQWJUrGi z+qTSBKQa+ESPXECLiEa4gHlEc89nWkaiLEkY37N9e1WE+hTm2Sj79KcSUuPy+03vm idVrUkgmFPZ9g== 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 To: , , , , , , CC: , , , Subject: [PATCH 7/8] leds: lp3952: explicitly unregister LEDs at module's shutdown Date: Wed, 25 Oct 2023 16:07:36 +0300 Message-ID: <20231025130737.2015468-8-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 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 pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:08:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780732985181974751 X-GMAIL-MSGID: 1780732985181974751 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 --- drivers/leds/leds-lp3952.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/leds/leds-lp3952.c b/drivers/leds/leds-lp3952.c index 3bd55652a706..2de49192011a 100644 --- a/drivers/leds/leds-lp3952.c +++ b/drivers/leds/leds-lp3952.c @@ -257,8 +257,13 @@ static int lp3952_probe(struct i2c_client *client) static void lp3952_remove(struct i2c_client *client) { struct lp3952_led_array *priv; + int i; priv = i2c_get_clientdata(client); + for (i = 0; i < LP3952_LED_ALL; i++) + if (priv->leds[i].priv) + devm_led_classdev_unregister(&client->dev, + &priv->leds[i].cdev); lp3952_on_off(priv, LP3952_LED_ALL, false); gpiod_set_value(priv->enable_gpio, 0); }