From patchwork Tue Aug 9 10:29:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 9270803 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 F30ED60754 for ; Tue, 9 Aug 2016 10:30:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E070727F8D for ; Tue, 9 Aug 2016 10:30:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D37F3280F4; Tue, 9 Aug 2016 10:30:39 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7979927F8D for ; Tue, 9 Aug 2016 10:30:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bX4Ip-0006J1-Qg; Tue, 09 Aug 2016 10:30:31 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bX4IJ-0004yL-0X for linux-amlogic@lists.infradead.org; Tue, 09 Aug 2016 10:30:01 +0000 Received: by mail-wm0-x229.google.com with SMTP id q128so24327904wma.1 for ; Tue, 09 Aug 2016 03:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w5/qlIw4XxTI2DlboUCSxXsBMX4RsVkwl1d1jAprKc4=; b=BSkbZgQjSobuF/OffQYveElmSwmilE0sDFid0JMXgal8yA6cab5q7uBAKOe0AKZBM0 tk5REJrhkWKALU2Hm7/mzXhksKZaD8EZhAhx9/v5n4DyJF1hA8PaH8exsjWSegGYBdWh dWsS20KsNzqWjTthoceXeUoQEBkzqDHaqVsKS7ThbXwsa33GbTlfdLl2lxIyupXrPmRK GbJUnofGUvEjqAoDKaMDmBV6ttXQ9FhSt2rLatmzWAhfFg/JVM+BX1xe2tLEISIbHU7x pFsJ/lbisCdW1h1UZ6XXPLUNhma9M9tsa8NBpchjY4mOb8qsbk+J4hEkyo8TeldNL4xT lB2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w5/qlIw4XxTI2DlboUCSxXsBMX4RsVkwl1d1jAprKc4=; b=mQQ2HB0Sd4ZFTtal2mZ7fxuyHbRPJY8SYNOgrDi6CLllk7J+1R9ocYcKxqm6IxA8p0 InpSuT8QuLihM1rQkVWeYx8QzC5GpC90fjo8QrMQdYAmYp2KV6OHwHUt2hFersGbgDZz uH+H3e601/PotbIaMyeXi3ObOVXLDWN1oCGA2JdACMbr90oxVxglWLv8r2T/eB6B2nEP 3c2QdHH56NOemZuJBPeC7Lz/EJWpSV22JD0AR6xCm8M1duAcZf5hNiXtSFKv4h4sMN7T kq1hKGt/NP78nONBBbpSB3VLH6Kiu6ZSYN5TBqQntIWNMwpIA8RC+NL/J7rbiJJCIaUn ix5Q== X-Gm-Message-State: AEkoous2eaG0Cg11JPlaGMnSHR/bbJo/0qCUpbWInF7rPF1sEQDylacaUbjLcdx5rst0Xm3y X-Received: by 10.194.134.234 with SMTP id pn10mr89418694wjb.35.1470738577301; Tue, 09 Aug 2016 03:29:37 -0700 (PDT) Received: from zoidberg.home (LFbn-1-1885-126.w90-73.abo.wanadoo.fr. [90.73.182.126]) by smtp.gmail.com with ESMTPSA id c139sm2624994wme.4.2016.08.09.03.29.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Aug 2016 03:29:36 -0700 (PDT) From: Neil Armstrong To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sudeep.holla@arm.com Subject: [RFC PATCH v3 2/8] firmware: scpi: Switch arm_scpi to use new registry Date: Tue, 9 Aug 2016 12:29:16 +0200 Message-Id: <1470738562-20026-3-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470738562-20026-1-git-send-email-narmstrong@baylibre.com> References: <1470738562-20026-1-git-send-email-narmstrong@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160809_032959_380249_C657C33E X-CRM114-Status: GOOD ( 10.71 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, Neil Armstrong , frank.wang@rock-chips.com, khilman@baylibre.com, linux-amlogic@lists.infradead.org, wxt@rock-chips.com MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Neil Armstrong --- drivers/firmware/arm_scpi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c index 4388937..c6d6528 100644 --- a/drivers/firmware/arm_scpi.c +++ b/drivers/firmware/arm_scpi.c @@ -162,7 +162,6 @@ struct scpi_drvinfo { u32 firmware_version; int num_chans; atomic_t next_chan; - struct scpi_ops *scpi_ops; struct scpi_chan *channels; struct scpi_dvfs_info *dvfs[MAX_DVFS_DOMAINS]; }; @@ -580,12 +579,6 @@ static struct scpi_ops scpi_ops = { .device_set_power_state = scpi_device_set_power_state, }; -struct scpi_ops *get_scpi_ops(void) -{ - return scpi_info ? scpi_info->scpi_ops : NULL; -} -EXPORT_SYMBOL_GPL(get_scpi_ops); - static int scpi_init_versions(struct scpi_drvinfo *info) { int ret; @@ -769,7 +762,10 @@ err: FW_REV_MAJOR(scpi_info->firmware_version), FW_REV_MINOR(scpi_info->firmware_version), FW_REV_PATCH(scpi_info->firmware_version)); - scpi_info->scpi_ops = &scpi_ops; + + ret = devm_scpi_ops_register(dev, &scpi_ops); + if (ret) + return ret; ret = sysfs_create_groups(&dev->kobj, versions_groups); if (ret)