Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp783077pxb; Wed, 20 Jan 2021 22:29:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoEayRMiVU5BERJ4qt8aRk91NbETWFtjvM2ykcYeH+VRts/o98o5UwcQj8MCjo+Rl7B3bI X-Received: by 2002:aa7:cb42:: with SMTP id w2mr10089920edt.21.1611210544058; Wed, 20 Jan 2021 22:29:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611210544; cv=none; d=google.com; s=arc-20160816; b=E7qowW6NFU6RGf3o3nIIpi1V2/oGINRIwKznyuKYiWCEyfiIlXCbe6qKYeO6hTcMfK evnoBApRmPlH38m8JKNa6QMwi5lqaOGWv103nir3jNZ4Z9KmiaA+hDResaeaDSfUCmbc HdAwuyLkM1mau+oj0RYE5wDuVlxRXPRIqiIHMtr0PddAG5Huiz8vzB6oXkkdKixHZTSN RF4YxvvrCOeVt11tcR3ZsyT1mYVic7PUyXgJ07BU2c14JmHOEM0hEpz8CT7G1mizzEHj JFafsd7OfIRfILOWLAXig1IdtAZtxWsbw6rzbVeXb/svdpEYUBFI4Zdr3iOUaoaWxbPu SO5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=g3H6XuP2moQ7yOqT43FohYxVjNiMywWx6jVLRMScUFQ=; b=gKNn4HanyH5V7J8vlW4Llp+lSaw7wjdGlXAWwr0DYDsApm+96PQpDcbgQ0X86+gKgF XWpI41OXWhSHVhE3YUjaLu5/0S+MAce2V6B9DoGyN3mbZ8BHNYplzIkSUFM9cWTBR77U vRUPAQgpwUw8Q8npE5DClzYr0O8J96fdvlg9RPro05Q0ZVoE8K8bOr+SR+aMZSsh2jBK CwXkyz1QR47QJeoiQ2DyKT9iCrtZBrg7Q+0PfgYbbJM/ar1pZ2i+JZLkgkVFGDN72M/T vwrWdEO5c9HD7bFrO0Bq7Cld7CAyr3+LVYdrZO8XHurW+g9+3iXBFftLy8S8HQyMi/fh zWIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a59si1854181edf.278.2021.01.20.22.28.40; Wed, 20 Jan 2021 22:29:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726590AbhAUG1P (ORCPT + 99 others); Thu, 21 Jan 2021 01:27:15 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:42019 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726931AbhAUGZ4 (ORCPT ); Thu, 21 Jan 2021 01:25:56 -0500 X-UUID: f850b44332cb458aa8d930e56f64993a-20210121 X-UUID: f850b44332cb458aa8d930e56f64993a-20210121 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 994015492; Thu, 21 Jan 2021 14:25:11 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 21 Jan 2021 14:25:10 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 21 Jan 2021 14:25:09 +0800 From: Yong Wu To: Krzysztof Kozlowski , Matthias Brugger CC: Joerg Roedel , Robin Murphy , Will Deacon , Tomasz Figa , , , , , , , , Nicolas Boichat , , Subject: [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers Date: Thu, 21 Jan 2021 14:24:27 +0800 Message-ID: <20210121062429.26504-2-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210121062429.26504-1-yong.wu@mediatek.com> References: <20210121062429.26504-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In this file, we have 2 drivers, smi-common and smi-larb. Use platform_register_drivers. Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index ac350f8d1e20..e2aebd2bfa8e 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -587,26 +587,13 @@ static struct platform_driver mtk_smi_common_driver = { } }; +static struct platform_driver * const smidrivers[] = { + &mtk_smi_common_driver, + &mtk_smi_larb_driver, +}; + static int __init mtk_smi_init(void) { - int ret; - - ret = platform_driver_register(&mtk_smi_common_driver); - if (ret != 0) { - pr_err("Failed to register SMI driver\n"); - return ret; - } - - ret = platform_driver_register(&mtk_smi_larb_driver); - if (ret != 0) { - pr_err("Failed to register SMI-LARB driver\n"); - goto err_unreg_smi; - } - return ret; - -err_unreg_smi: - platform_driver_unregister(&mtk_smi_common_driver); - return ret; + return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers)); } - module_init(mtk_smi_init); -- 2.18.0