From patchwork Fri Sep 29 21:44:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9978747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DA11160311 for ; Fri, 29 Sep 2017 21:49:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCA4E298C8 for ; Fri, 29 Sep 2017 21:49:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1C91298CA; Fri, 29 Sep 2017 21:49:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 713DD298C8 for ; Fri, 29 Sep 2017 21:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:Subject:From:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nwBeeAlsx6Se2lT1IV4youxxgUdCxyAm+wQmVDg8fmA=; b=VRhT+oY8AmUmay tBZ6aZrHt/HqgnpTXpH4x9rRL7pdJ4qEMYcNXWsD0Kf369QDsEn4z9X+3qRMs6sE7+l20HZhYBQ6B 7IVRYXYdJ1nqAQKQ+I8nKwrpiSHDxcazsxcduHDn0oY4iU7/rcGTfv59L9osQs8XZqlC944LRBxos OSrwp00TIJhgcQy0PahDHSlRFb/JVld7Va2K83sENRdTrWqvEMSQf0LK5DuEZmp/h/PkMvJoSzi1P uT8GWNBSHv8XAiWaCqwGGJykrvYTiqyAZbGRGlWQABkwXEE5Yyt/FCCu/jhsn2qoYbI/KRQ1M2ghs MHuN6IiUV5GK8hG2qKhw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dy3AK-0003Rp-CA; Fri, 29 Sep 2017 21:49:48 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dy35S-0000Dh-S8 for linux-arm-kernel@lists.infradead.org; Fri, 29 Sep 2017 21:44:48 +0000 Received: by mail-wm0-x243.google.com with SMTP id r74so493894wme.3 for ; Fri, 29 Sep 2017 14:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=JmB1MbWpb99kOQvV1EZhEwG+3EaQA4696zeO5qhPk70=; b=nzHH2/tVkLqHLqODybOpTxkjYsF2kZvMaWxmiys9rfyie/ZNAj6kxizjg7ex8XLmDo pHNjIzF+GYtP9PdyeEN8kC7g5QpDrs06cs+lVJswjCaAcW2PEFUxCI9A3SS0YPHjwX27 GBzzfpE/hdvQCwNfE+CFe4W7NXjO3k/33XuoBt5ziTZWF7hT64moAYp236US3rJ97mgv OrpabIftU1MFvqoedmI55zif8isQvvYdfDr61ILQxkim+ZgUScYtimz3BjF/F3aqun1j YEv8D8WXDOppuSHoiw/mgIlaFUajdVOPed7D6aruO465OKJSUGif+mcKiy+nMY3z2tdV SYNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=JmB1MbWpb99kOQvV1EZhEwG+3EaQA4696zeO5qhPk70=; b=N9UEdyUMP6bpDeraU75UDhjc71k/nhXf4PMtbTBJvwx63X0s0GpzOxxUX+mJPOsUYu 4Li5GLhWi4FBG4LBHRRS7NS8Iq0+rQzWtc7DrkUSTVwzC44stfbSy/Raozg3mc44TkBt w/bYoJ5DGPKI3e8JekyKtVDXSfTigny7WlI4kLrrb17rOjhDg+/fkyLLATvKv1kkJR5C k+ECYc5f6qvqRDMSebR/2H8ImNa0ryLaHcwCsT7qxd0bvnz8RYDneTur5jdoAjYhFI0+ lvVAvryySrMZ5meZcj3JfVrrmHzzCVXLODbmZxbmstIyPPC3yKZETEGStBgIQ6DUQKCN 2Iyw== X-Gm-Message-State: AHPjjUhFihFNqBeRJ4NzG7Wzm4DH7oWA7VxqsotBCqiZlPSmtetY0G9y nIpNQL7Sr6GNNwKvUXt+W/xx3w== X-Google-Smtp-Source: AOwi7QBe0alyFGs6mc5BRQr0H4mpFg3pKoaMZuxN9Fiw0/h228MdxkZL1iZl7GEC1lA36A3IxbXAhA== X-Received: by 10.80.203.204 with SMTP id l12mr11247422edi.122.1506721466492; Fri, 29 Sep 2017 14:44:26 -0700 (PDT) Received: from ?IPv6:2003:ea:8bcb:c500:506a:6c9b:118a:c899? (p200300EA8BCBC500506A6C9B118AC899.dip0.t-ipconnect.de. [2003:ea:8bcb:c500:506a:6c9b:118a:c899]) by smtp.googlemail.com with ESMTPSA id e29sm5472908edd.28.2017.09.29.14.44.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 14:44:26 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 5/5] firmware: arm_scpi: remove scpi_remove To: Sudeep Holla References: Message-ID: Date: Fri, 29 Sep 2017 23:44:15 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170929_144447_176155_B57DD47B X-CRM114-Status: GOOD ( 11.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP sysfs_create_groups and of_platform_populate can be replaced with the device-managed versions what allows us to remove scpi_remove. Signed-off-by: Heiner Kallweit --- drivers/firmware/arm_scpi.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c index c91f3241..a71907e6 100644 --- a/drivers/firmware/arm_scpi.c +++ b/drivers/firmware/arm_scpi.c @@ -911,16 +911,6 @@ static void scpi_free_channels(void *data) mbox_free_channel(info->channels[i].chan); } -static int scpi_remove(struct platform_device *pdev) -{ - struct device *dev = &pdev->dev; - - of_platform_depopulate(dev); - sysfs_remove_groups(&dev->kobj, versions_groups); - - return 0; -} - #define MAX_SCPI_XFERS 10 static int scpi_alloc_xfer_list(struct device *dev, struct scpi_chan *ch) { @@ -1038,15 +1028,12 @@ static int scpi_probe(struct platform_device *pdev) ret = scpi_init_versions(scpi_info); if (ret) { dev_err(dev, "incorrect or no SCP firmware found\n"); - scpi_remove(pdev); return ret; } ret = scpi_dvfs_populate(dev); - if (ret) { - scpi_remove(pdev); + if (ret) return ret; - } _dev_info(dev, "SCP Protocol %d.%d Firmware %d.%d.%d version\n", PROTOCOL_REV_MAJOR(scpi_info->protocol_version), @@ -1055,11 +1042,11 @@ static int scpi_probe(struct platform_device *pdev) FW_REV_MINOR(scpi_info->firmware_version), FW_REV_PATCH(scpi_info->firmware_version)); - ret = sysfs_create_groups(&dev->kobj, versions_groups); + ret = devm_device_add_groups(dev, versions_groups); if (ret) dev_err(dev, "unable to create sysfs version group\n"); - return of_platform_populate(dev->of_node, NULL, NULL, dev); + return devm_of_platform_populate(dev); } static const struct of_device_id scpi_of_match[] = { @@ -1076,7 +1063,6 @@ static struct platform_driver scpi_driver = { .of_match_table = scpi_of_match, }, .probe = scpi_probe, - .remove = scpi_remove, }; module_platform_driver(scpi_driver);