From patchwork Sun Nov 20 13:01:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 23413 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1113492wrr; Sun, 20 Nov 2022 05:26:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf5v3gR0K6BHZ1c8sRHDXHjUZ2mTbi3u1HinHUUEXeItI+Tk70YEE/jFzelmnE5t/BeTj2Sv X-Received: by 2002:aa7:d996:0:b0:469:8530:cbbe with SMTP id u22-20020aa7d996000000b004698530cbbemr1387621eds.134.1668950760942; Sun, 20 Nov 2022 05:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668950760; cv=none; d=google.com; s=arc-20160816; b=q2uixZRevidI3ZZGUZrFr8jpYvgD+j4u6N2VMnggWjzKFM2eiSOZcPQv+QH/c/SvyW j4HmCoMz4bSkTUzTRA3hXfSDaFadS6fBBA/pP1U4KEt7KtnigeQ7XANnaiATmXBuYuMF CG0XKFx85911kQ4hxOyHHL/BMdpRsBwKMDh33t+cfnR/+HiJbLDJcGhlLBThFGENnJ+S nJlMvpRXQ9nAEMWk2QKDV/6lcBmeHA2l7A/UkbLJf+T2NJp18rlreyf+5lzNFZCMbuK0 sD0LO9KFzptOD5vPPhJ1jsGUKgpH3xYmmciiFHuYy4Ld7FtEYWM1fKvQPSonpI2OnUC6 oBsw== 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; bh=0zP+tgRp14WAkF1K03JxH/MSmkVWw+vc/T8kVIxKmeI=; b=IykjBTIal7HKrZkP7AwUDAZrncJ6wptpOshh6xNTSCs8iAN2yJH4xYU8aB7aTz3i3J Fd7VPuGYkA0nPmMa7KKT1fv1uNfDBqKGKiS9meHfGCXeRchaUOp7trIPBOO81P3YAmaI 4OjHqASa0exOqATqVKnU3iw2ABAEi6Xz+P+hAwbiK/IQsVP8YzRxMGQlHvB4MRvvXUdk sYi9nt9M7TRAJPwseTua8Y2FfNngPatYDzHYqtb0EB2UPPg31Qur+s+18LEOd1i93W30 mVWht+fuJXBiAkm5J5VpvEgKC8y/V+zm9Qmw/lcQ+rJ8s3ckL4q8uMlVroL11tRxgvrU WVvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020aa7c1c5000000b0045dbfc32399si6977971edp.552.2022.11.20.05.25.32; Sun, 20 Nov 2022 05:26:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbiKTNBz (ORCPT + 99 others); Sun, 20 Nov 2022 08:01:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbiKTNBu (ORCPT ); Sun, 20 Nov 2022 08:01:50 -0500 Received: from smtp.smtpout.orange.fr (smtp-18.smtpout.orange.fr [80.12.242.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EE8B20BF0 for ; Sun, 20 Nov 2022 05:01:49 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id wjxAo2gcMCoWhwjxDotLEw; Sun, 20 Nov 2022 14:01:48 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 20 Nov 2022 14:01:48 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Lee Jones Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-msm@vger.kernel.org Subject: [PATCH 2/2] mfd: qcom_rpm: Use devm_of_platform_populate() to simplify code Date: Sun, 20 Nov 2022 14:01:43 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750021712983365825?= X-GMAIL-MSGID: =?utf-8?q?1750021712983365825?= Use devm_of_platform_populate() instead of hand-writing it. This simplifies the code. Signed-off-by: Christophe JAILLET --- This changes the order of the clean-ups if the .remove() function is called but it looks fine to me. --- drivers/mfd/qcom_rpm.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c index ea5eb94427c4..8fea0e511550 100644 --- a/drivers/mfd/qcom_rpm.c +++ b/drivers/mfd/qcom_rpm.c @@ -672,21 +672,11 @@ static int qcom_rpm_probe(struct platform_device *pdev) if (ret) dev_warn(&pdev->dev, "failed to mark wakeup irq as wakeup\n"); - return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); -} - -static int qcom_rpm_remove(struct platform_device *pdev) -{ - struct qcom_rpm *rpm = dev_get_drvdata(&pdev->dev); - - of_platform_depopulate(&pdev->dev); - - return 0; + return devm_of_platform_populate(&pdev->dev); } static struct platform_driver qcom_rpm_driver = { .probe = qcom_rpm_probe, - .remove = qcom_rpm_remove, .driver = { .name = "qcom_rpm", .of_match_table = qcom_rpm_of_match,