From patchwork Mon May 10 19:09:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12249231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E61CC433B4 for ; Mon, 10 May 2021 19:10:04 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1368461139 for ; Mon, 10 May 2021 19:10:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1368461139 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gKfS+ZqPhwZcgmxCQYDn3nmlUIcI0f1tAWfDiGA38mg=; b=BWfzK12L43bTsoGrxIihxVQB1 CBjjDVZqu8/Y2UZ2nNy8TQtrs5nDrJgDvCBnm48LV5wewEpmNoT11YTwU0l9BnnFLRrHZyCJ3K4iN 97A91o4iZr/jCngjxQlZh2mmbcA0WNqSpfI8GfL+l382W0qi3t8cwAhN9rXDZ7VTIqf8ZvQDiGUkm FsrNPNwoKd1zurdUMxHUyn7D5YlLkwXrPw4M6fK8BdhQo/2MSqBlTLx17zGrnWhHwWWSCcrBNsHiB 1eXIhYh+6ihlmgM+6sc+MYF2mWYnIgCI3IheBw7tTbZFfivDAFkFO5ToyBrLxoBy3lmU9a2RwzBe9 KA6yMbhUQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgBHx-00FVRO-FU; Mon, 10 May 2021 19:09:57 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgBHu-00FVR3-Cz for linux-amlogic@desiato.infradead.org; Mon, 10 May 2021 19:09:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=POghwcEHgR+BrYrIP4dZE38R/2StYIPNSYU5lSvbKM8=; b=w/zvtE1GNJJ8pKloq/00cdOgmB 3VaPHMWGZM0QhUj/7b4OnFLi/9jTaBZ9XWcZ2lPWGZVbd0AezJV0GpnVdiT1HPr9MZf3LozPgPBn1 VKgeYY9YJ2g6kOP4G6sQ1CYXQ5XHwwrRIknpOZ3LfyVDqB/RYZey4vVF8Dwlhu2nru/miGF1QibeW /Yatnw1MKNhvWmUratt1bmuv+PhgES3U1ky1Kn5ErPEj8cb0fM/IRhsOtSNwLvFegTQ3TNKu/VHUM /QmnmEHyuTTeZ95M+mr25/UpWnLszI7HNeA1MxcN4LwfVwvq8RR3IhWZ8VrcnhAn7ieARv4iYeEZk eDLoKsrQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgBHr-0093dN-Vq for linux-amlogic@lists.infradead.org; Mon, 10 May 2021 19:09:53 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgBHj-0007Yu-Bt; Mon, 10 May 2021 21:09:43 +0200 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lgBHi-0003S1-Tm; Mon, 10 May 2021 21:09:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Romain Perier , Thierry Reding , Lee Jones , Kevin Hilman Cc: Neil Armstrong , Jerome Brunet , Martin Blumenstingl , linux-pwm@vger.kernel.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH v2] pwm: meson: Simplify using devm_pwmchip_add Date: Mon, 10 May 2021 21:09:25 +0200 Message-Id: <20210510190924.990912-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-amlogic@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_120952_049508_29DFD600 X-CRM114-Status: GOOD ( 15.15 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Signed-off-by: Uwe Kleine-König Acked-by: Martin Blumenstingl --- Hi Romain, On Mon, May 10, 2021 at 08:42:07PM +0200, Romain Perier wrote: > The "struct device *" as first argument is missing, nop ? Damn, you're right. Here comes v2 after enabling the meson driver in my test .config :-\ Best regards Uwe drivers/pwm/pwm-meson.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) base-commit: 6efb943b8616ec53a5e444193dccf1af9ad627b5 prerequisite-patch-id: fa39cd0c852d109ed957dc44dca5bdcf5dff0685 diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c index 9eb060613cb4..fc5a0acb7eb9 100644 --- a/drivers/pwm/pwm-meson.c +++ b/drivers/pwm/pwm-meson.c @@ -560,31 +560,21 @@ static int meson_pwm_probe(struct platform_device *pdev) if (err < 0) return err; - err = pwmchip_add(&meson->chip); + err = devm_pwmchip_add(&pdev->dev, &meson->chip); if (err < 0) { dev_err(&pdev->dev, "failed to register PWM chip: %d\n", err); return err; } - platform_set_drvdata(pdev, meson); - return 0; } -static int meson_pwm_remove(struct platform_device *pdev) -{ - struct meson_pwm *meson = platform_get_drvdata(pdev); - - return pwmchip_remove(&meson->chip); -} - static struct platform_driver meson_pwm_driver = { .driver = { .name = "meson-pwm", .of_match_table = meson_pwm_matches, }, .probe = meson_pwm_probe, - .remove = meson_pwm_remove, }; module_platform_driver(meson_pwm_driver);