Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp755168pxk; Thu, 17 Sep 2020 15:39:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx81vZyGZWN7arIPRgzU/MIaSabZd2797NAVyRoB7gy3hgTu8zpsl6hvLz9/jqNOAM/sCPh X-Received: by 2002:a50:ed02:: with SMTP id j2mr22083531eds.137.1600382372508; Thu, 17 Sep 2020 15:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600382372; cv=none; d=google.com; s=arc-20160816; b=ZjqNsq+fjY/wUH6IcLfPwqhVaohOi2z+qXsVY+/lHFtcpoS0LZ7NHVy4c1Wd26b+qo F+nxuW77N3O+blFNLnZJXYukw3Zr2U4b08LWYDaC3G7HGSrqteZc7M0RgGrL4y7EfBKF yPgvQZcMa/hAAtir2uRQ7pfRr81xTiOl0TgekfGo6xOTHP2s2Et6LVj1jSvlrzJHIbMz pWM6f9RiIrg7vaEVT26iVk5v6iFvtvBs5Bv/vCBW3qcpMALTJedMa9Gy+g+lboJ1FYde 0nNnJ/d8gI5ABHfor9Y60dInzneCebmlPdI4Fwz0FaSKe1ikA+2RaNTMHVFDtL/RjGD8 Qlzw== 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; bh=7LHLOqzZbtMqYLp4K4wae7vDgQY3RqqEIS5YiB+CMcA=; b=Pd+CXAA2YdDgqoelpdeFXVfKA81PrzxcY7YZdLF4gHCY+QXfJBptdRQyHjj4EkPxsh oV0U0+OWEi4ZepG3XFJS2AlBSzECyQrvTEZWevCeBym9kww+04BHHxO2xdosQVX1vdR3 dCIQoX2kvfEQ/PAbt+StD+WjR9N8alN2TzgYVbUid2GymsMlJPsBa2UEyoHck0WOM3BQ RBT4UU7O1R1bqbRkBhYO+BjXu0nc6kmW4yxAWKlYqQnAMynTSwUXXCaxpPH6GGmjCk+A j04OZEB2sN8tdORdkgww/U5Zb+2G3Q1AcRazkbdPi16sv/Py1i6Tjrm6K2hN3yj6ZReA QvFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nic.cz header.s=default header.b=iQhyU+Il; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ss23si866572ejb.350.2020.09.17.15.39.09; Thu, 17 Sep 2020 15:39:32 -0700 (PDT) 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; dkim=pass header.i=@nic.cz header.s=default header.b=iQhyU+Il; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726732AbgIQWfi (ORCPT + 99 others); Thu, 17 Sep 2020 18:35:38 -0400 Received: from lists.nic.cz ([217.31.204.67]:35966 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgIQWeM (ORCPT ); Thu, 17 Sep 2020 18:34:12 -0400 Received: from dellmb.labs.office.nic.cz (unknown [IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463]) by mail.nic.cz (Postfix) with ESMTP id D716114204F; Fri, 18 Sep 2020 00:33:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1600382039; bh=eylOQwNosH/+MyVb6B6nwrcWha3E/L2/PYtCFaINitQ=; h=From:To:Date; b=iQhyU+IlP4KS61v6ki2GZPU4Ua1sXoO++IO2lnECdkJKXYkd9ICBqGySB25JmM9hh F7UxZ+kQlqGUlCQ6WbGTGFQbHi4IZkpopxQCIHzI4B5rhDU1Ktz69jOaY+z0W5ooh3 7HWE0P/tluLzpVfnxuvbCaFrJNDtBhXLEWobnkbs= From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: linux-leds@vger.kernel.org Cc: Pavel Machek , Dan Murphy , =?UTF-8?q?Ond=C5=99ej=20Jirman?= , linux-kernel@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH leds v2 31/50] leds: lm36274: use devres LED registering function Date: Fri, 18 Sep 2020 00:33:19 +0200 Message-Id: <20200917223338.14164-32-marek.behun@nic.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200917223338.14164-1-marek.behun@nic.cz> References: <20200917223338.14164-1-marek.behun@nic.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Spam-Status: No, score=0.00 X-Spamd-Bar: / X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org By using devres version of LED registering function we can remove the .remove method from this driver. Signed-off-by: Marek BehĂșn Cc: Dan Murphy --- drivers/leds/leds-lm36274.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/leds/leds-lm36274.c b/drivers/leds/leds-lm36274.c index bfeee03a0053c..1390c71267cc2 100644 --- a/drivers/leds/leds-lm36274.c +++ b/drivers/leds/leds-lm36274.c @@ -147,16 +147,8 @@ static int lm36274_probe(struct platform_device *pdev) return ret; } - return led_classdev_register(lm36274_data->dev, &lm36274_data->led_dev); -} - -static int lm36274_remove(struct platform_device *pdev) -{ - struct lm36274 *lm36274_data = platform_get_drvdata(pdev); - - led_classdev_unregister(&lm36274_data->led_dev); - - return 0; + return devm_led_classdev_register(lm36274_data->dev, + &lm36274_data->led_dev); } static const struct of_device_id of_lm36274_leds_match[] = { @@ -167,7 +159,6 @@ MODULE_DEVICE_TABLE(of, of_lm36274_leds_match); static struct platform_driver lm36274_driver = { .probe = lm36274_probe, - .remove = lm36274_remove, .driver = { .name = "lm36274-leds", }, -- 2.26.2