From patchwork Tue Dec 5 22:16:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10093875 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 691976056E for ; Tue, 5 Dec 2017 22:18:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B5EF289BC for ; Tue, 5 Dec 2017 22:18:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5020429582; Tue, 5 Dec 2017 22:18:38 +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 D2A7D289BC for ; Tue, 5 Dec 2017 22:18:37 +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=BZU/oJuuOxbtPn13u6vd3Dmtx5mi43S2hKgX92mXBmk=; b=rxS7cIvLBF1eBe KBLUe4uGw92DrArsUA8cXbXP546J7z95UiRc9DK6wREIMT74KBykhk30gCa5aO4Pmij26X2xhJIs+ n9gdGFsBjuR8BRCYqeOAx1vpYnZkELG4S/915D2krsCecgTsXpnP9RZZuUvL8zpmFmf75fsqrbnwi c7OjPkJ5muly7c+Z0ALwmA3+ZCcFROo688oTZ5uDf7oX4HzM1Q2kL3UzpC5dpb0FkoPcBGwyEzXik UNatll6S36XxpG3MnF81teNJ2f41OS5Szad5D2zsCRMnoAR0OumCFEZsLA+lgX04pmIXJaD4Zgd9B l2gppzRWmiQjjk6gFY9w==; 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 1eMLXw-0007kd-UA; Tue, 05 Dec 2017 22:18:37 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eMLXC-0006zf-PZ; Tue, 05 Dec 2017 22:17:52 +0000 Received: by mail-wm0-x242.google.com with SMTP id t8so4031552wmc.3; Tue, 05 Dec 2017 14:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=KEy2JXJyD89FRzgpHUNOsZRNq7ZcI/VhqWaoxyVZP7I=; b=PRxr2CZlIgsKZMzndlE07ypCdYLVozV8IUkXPg2PTHn9dJLj/0QGfhdcjzlU/tnQ3S yc2XFew+oDb15Lz1EzDkHCG6AJXCZ6vtm/5nYN03SsXurdLiphKgIBqKVwZuuXf0tzzl VO0hhTPoCHTH3gQ9geLrNui/81EBvwvZnB5Wg+8jRRE8ZG656b22ZMkZT228lkI738xL ESZikqrvfKi/pyu7wecm8CFOnfm4RIbRC+EOUnqohA3pMIkCwXG0FVM9HCJjQLlX4fiR KdfQJMNDbgzByUd0OkibJg0TNy+UEpmIBpFB3JX2w4lMoCKo67XDkbTI5N0B+evPZ0Zh giYg== 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:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=KEy2JXJyD89FRzgpHUNOsZRNq7ZcI/VhqWaoxyVZP7I=; b=ig36eQzQlI6/xIfAYUnopNpWvhxVMclat72kDVo94EWVgWDskNqWvoqC0gk4zx1pRA I4a0q/XC0ZwqBF5lQtl9wCXmHj64eYKb/IdA+Ln0USKTSweCPnAab55V1IWU9W8dUs0X b3l5s5IqbeBKuUSLrrlrOSmMH6GUNNqwJHAEXyh873afHxC5Wd47odKei/7A5YG/pFum ZRY9E0tQM4XzjbeInl+KEVBCr68UDTtys+Z+9waCWttDeCgMstjKVu54kp1O9PV0+YaG L4HqJ3usODWNcn2Gr7AZYrDKfME+MkIO9R/MHDAbxS55q5Cxxthx3gdDVQ4byYrcxR3l aQew== X-Gm-Message-State: AKGB3mL8D761ds4AmqKcD3pjNbX0UOKUiFzLNnGeaCn1/i10v9zZphLj KQ0ruTBGyeF6KD67/3FUYlb+ew== X-Google-Smtp-Source: AGs4zMZ3hwOGR96pUsPL7YHi2ZRmOf65w4dMMC1enX10GNQteHEWWBSTWNfs1hsYRVgfk8ARrCMPRw== X-Received: by 10.28.60.8 with SMTP id j8mr7052383wma.136.1512512249026; Tue, 05 Dec 2017 14:17:29 -0800 (PST) Received: from ?IPv6:2003:ea:8bc0:e400:b595:9d9d:56de:88e3? (p200300EA8BC0E400B5959D9D56DE88E3.dip0.t-ipconnect.de. [2003:ea:8bc0:e400:b595:9d9d:56de:88e3]) by smtp.googlemail.com with ESMTPSA id n129sm1474562wmn.38.2017.12.05.14.17.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 14:17:28 -0800 (PST) From: Heiner Kallweit Subject: [PATCH 03/12] firmware: arm_scpi: make scpi_probe completely device-managed To: Sudeep Holla References: <99220c79-8b35-2978-11d1-6d101ccb6772@gmail.com> Message-ID: <58c40520-bc3f-b4d2-a400-c2b6b18e7422@gmail.com> Date: Tue, 5 Dec 2017 23:16:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <99220c79-8b35-2978-11d1-6d101ccb6772@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171205_141751_079159_70F9F270 X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. 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: "open list:ARM/Amlogic Meson..." , "linux-arm-kernel@lists.infradead.org" , Kevin Hilman 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 Replace two remaining functions in probe with their devm versions. Signed-off-by: Heiner Kallweit --- drivers/firmware/arm_scpi.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c index 4447738d..a6f6039e 100644 --- a/drivers/firmware/arm_scpi.c +++ b/drivers/firmware/arm_scpi.c @@ -901,15 +901,10 @@ static void scpi_free_channels(void *data) static int scpi_remove(struct platform_device *pdev) { int i; - struct device *dev = &pdev->dev; struct scpi_drvinfo *info = platform_get_drvdata(pdev); scpi_info = NULL; /* stop exporting SCPI ops through get_scpi_ops */ - of_platform_depopulate(dev); - sysfs_remove_groups(&dev->kobj, versions_groups); - platform_set_drvdata(pdev, NULL); - for (i = 0; i < MAX_DVFS_DOMAINS && info->dvfs[i]; i++) { kfree(info->dvfs[i]->opps); kfree(info->dvfs[i]); @@ -1036,7 +1031,6 @@ 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; } @@ -1048,11 +1042,11 @@ static int scpi_probe(struct platform_device *pdev) FW_REV_PATCH(scpi_info->firmware_version)); scpi_info->scpi_ops = &scpi_ops; - 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[] = {