From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE10BC433E0 for ; Mon, 3 Aug 2020 17:14:14 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 995CA20A8B for ; Mon, 3 Aug 2020 17:14:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="q0nXctG7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="P3S8N2W0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 995CA20A8B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7f9g3tD7XeG4npKtQeQIfD4JSpTUnykh5Lqdpwi12Hs=; b=q0nXctG7z6bBmNJdElqR8G/x+ Kk4SQRA93TizBJeHwNkJ3VHBNIK+wFOPhcGsbkD6MaGGJFLV3k0JJ0vhgMR/eaZodMQoOS4eR959V 4eRm+TN/aeAfpofALLoAStlCxX6L60Vuz0LrPpqfTBs0fXMM9SWbPKr0eaW9tR8rmTfqy9CS06aWy Itfb1H2lxplPtKAt+WsUUUJ0TLcKL/mJYfCN6sgNMKWEH6+jEvrgd7xKERDRtqUcEqFeSbB5WJif9 qTjoxELitp9Y98HTwFqxnAq0dgER9Yg4DcJh1aL5olC6XjJc4ceHpD8CLXnBPI2zKoBpeKqeNSqXt hiRDK0Xsw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2e0U-0005uq-Jl; Mon, 03 Aug 2020 17:12:15 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2e05-0005hf-H7 for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2020 17:11:51 +0000 Received: by mail-ej1-x643.google.com with SMTP id a21so39414610ejj.10 for ; Mon, 03 Aug 2020 10:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9HBqCKTF3S1nrgr44RwHuFMicsKImVgaIrJppsIEqPQ=; b=P3S8N2W0qASw2GOPrgd5H8cDA0FxWsFj+XeBqOQjMaa68b+h1nzxjh/6LdjA7tS72C Lf1oeJTEDqalQvMn9oedDBTWmWE7C+XZiU1i7n50/EecDYOaYt42mZYwbldKhXx77ctx nnA+FHPJM+GTP8UeGwaWhlNA5yaGniMkciG8rkiC2J1AzIeI4mUXD4A9u80hZUOZp4eM mdPu4jpQ9FLEKV2S6pMWUDE5T8q7Y6eSprrLPswUMgTWfYqKbgwGih71mh+7TOBHtlNq MFR1BlInz6+8UNgO+V5UkTgxvNkkrSBIIYBEAoXozppUYlwgIQWCJMCB5MyIB7GMDofP AUqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9HBqCKTF3S1nrgr44RwHuFMicsKImVgaIrJppsIEqPQ=; b=N1Cr7NuBQZjRk5acxf7S/rB7MFRaVjB81iUMFyVs5RkBkXcNjSa1VmTSBfMMylO4qZ lHqbG4VveCphmi2/WW8i/6jE0RWTK+4LkWSQQzm+7GAJTw3H411eI9Dj15RsY+dLpMD1 S3JQJ9QHBEXl+Gi8JQMb8Su7wv/HvedF0yhYnuUFf+0nBlwq9V5qsi6u7Go1cVblJkU+ LtdHzjkTR9Zlk+r68+GcFf6Cf/nM+3MG44CnOK0ArDRylmJj146Q7ALaDQGVU039Y65G ZgrdK/9iFtTvjL809Wex7c+Gb70EuSzHqzX0vOIw7STzCMUIdHrMjbeN1WapmKEAi8dL EFLQ== X-Gm-Message-State: AOAM531570a9hFIWy4hw3WytNq1ddTG8EVSGMjLa/aUiRzGvPBmRp8vA +sRC0wPLPFcs9bGPCd+LLr4eTuGyi139yrhEMtHQjA== X-Google-Smtp-Source: ABdhPJzd/qUisr2lyUcE9/vcnL72SRhQ3hS6SUvsA3g6huU4Ps5UpvElgin1CsyRidE6z4YMpVNjo6mZU3Hh7lR6bBs= X-Received: by 2002:a17:906:b815:: with SMTP id dv21mr17320790ejb.517.1596474708589; Mon, 03 Aug 2020 10:11:48 -0700 (PDT) MIME-Version: 1.0 References: <20200731064012.8076-1-tingwei@codeaurora.org> <20200731064012.8076-16-tingwei@codeaurora.org> In-Reply-To: <20200731064012.8076-16-tingwei@codeaurora.org> From: Mike Leach Date: Mon, 3 Aug 2020 18:11:37 +0100 Message-ID: Subject: Re: [PATCH v6 15/25] coresight: replicator: remove multiple init calls To: Tingwei Zhang X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200803_131149_726581_DCC5158A X-CRM114-Status: GOOD ( 21.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tsoni@codeaurora.org, Sai Prakash Ranjan , Kim Phillips , Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , Greg Kroah-Hartman , Coresight ML , Randy Dunlap , Mian Yousaf Kaukab , Russell King , Mao Jinlong , Leo Yan , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 31 Jul 2020 at 07:41, Tingwei Zhang wrote: > > From: Mian Yousaf Kaukab > > Dynamic-replicator uses module_amba_driver to register. Whereas > static-replicator uses builtin_platform_driver. Combine these init > calls into a single module_init/exit pair in preparation to make the > driver modular. > > Signed-off-by: Mian Yousaf Kaukab > Signed-off-by: Tingwei Zhang > --- > .../coresight/coresight-replicator.c | 30 +++++++++++++++++-- > 1 file changed, 28 insertions(+), 2 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c > index 78acf29c49ca..6b30bcee7458 100644 > --- a/drivers/hwtracing/coresight/coresight-replicator.c > +++ b/drivers/hwtracing/coresight/coresight-replicator.c > @@ -360,7 +360,6 @@ static struct platform_driver static_replicator_driver = { > .suppress_bind_attrs = true, > }, > }; > -builtin_platform_driver(static_replicator_driver); > > static int dynamic_replicator_probe(struct amba_device *adev, > const struct amba_id *id) > @@ -383,4 +382,31 @@ static struct amba_driver dynamic_replicator_driver = { > .probe = dynamic_replicator_probe, > .id_table = dynamic_replicator_ids, > }; > -builtin_amba_driver(dynamic_replicator_driver); > + > +static int __init replicator_init(void) > +{ > + int ret; > + > + ret = platform_driver_register(&static_replicator_driver); > + if (ret) { > + pr_info("Error registering platform driver\n"); > + return ret; > + } > + > + ret = amba_driver_register(&dynamic_replicator_driver); > + if (ret) { > + pr_info("Error registering amba driver\n"); > + platform_driver_unregister(&static_replicator_driver); > + } > + > + return ret; > +} > + > +static void __exit replicator_exit(void) > +{ > + platform_driver_unregister(&static_replicator_driver); > + amba_driver_unregister(&dynamic_replicator_driver); > +} > + > +module_init(replicator_init); > +module_exit(replicator_exit); > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project > Tested by: Mike Leach -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel