Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9120634ybl; Fri, 17 Jan 2020 06:41:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwn64MpqH7rlCviUsFHRn4LhA++UsiCyTzUjBHOl+H6Gd9+wJTRKcOMm5ktBMmoEIz1S2MI X-Received: by 2002:a05:6808:486:: with SMTP id z6mr3678070oid.117.1579272094550; Fri, 17 Jan 2020 06:41:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579272094; cv=none; d=google.com; s=arc-20160816; b=NXE4i42s/WopcffgvlvQAQ52hrGkOmTHp+Uw+uTTleoJ3qcHNM58/MP7Rkrh4v0Srb C+zfZu1NIajmGtbP0k4Jcg/QG5wSFDC+wVErI9iqlTQY/Ok9dgmNV4IohMjQz/wM3FQS KhD4AtLFuxBuczonCfKN/kwBcn/5l1jL9MvyasSUpH6dedmzL7klRoCXFIq46E9jYkyj 7DgNBoqoQ2rB0IT/7t6Uo/cuiVPh2nLwNk+lZl9ISrswYb/ZV8D8aU+U/SAsVlDxlKr6 zc5PdSM6ejoqq9N+HAjdiqxA1pKUD/fWHJsp0C/umRBvgj69C4qLq/P7uxLl0zkvMHqC 3aKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=vBI9egJSD/qXOvftnvvTOCW+p3y2WAmlQuMrY6o2Ky4=; b=qxOekijj/HDQXV7oO0Ce3NMPEoKMyRMlIm6pkW0LzxMglB8OU8/YZ2S5p+UKe7eXkH jRTdZFImzxhtMI4l7ixE6DC3f81/etLa21/1DwJ0KZq+jQNOjgaadIKCmYaf+dCth75w xETwY98itmSvQkqzHE5MmCIClDk65DZUUu3XxTXPf7QvUiKJLJV5gbKPXrpTpPfTSSPk KOA7z4SSXUsIGIvXrAdaYHWbQz3FPDs5ZzVY1Zcy8+3ijBR9itnyg7yuw/kvG+AvNjAi yaE0rbeB+V0WNsHY1Egcf0Yuq34tRGZO4HddMQUluIDATIjoYZR5SSKQOhoA25YvmUXq P3ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si16371068oto.129.2020.01.17.06.41.22; Fri, 17 Jan 2020 06:41:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728946AbgAQOjD (ORCPT + 99 others); Fri, 17 Jan 2020 09:39:03 -0500 Received: from mx2.suse.de ([195.135.220.15]:57410 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727243AbgAQOjC (ORCPT ); Fri, 17 Jan 2020 09:39:02 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 29BCDABE9; Fri, 17 Jan 2020 14:39:01 +0000 (UTC) From: Mian Yousaf Kaukab To: linux-arm-kernel@lists.infradead.org, mathieu.poirier@linaro.org Cc: linux-kernel@vger.kernel.org, paul.gortmaker@windriver.com, suzuki.poulose@arm.com, alexander.shishkin@linux.intel.com, Mian Yousaf Kaukab Subject: [PATCH RFC 02/15] coresight: remove multiple init calls from funnel driver Date: Fri, 17 Jan 2020 15:39:57 +0100 Message-Id: <20200117144010.11149-3-ykaukab@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200117144010.11149-1-ykaukab@suse.de> References: <20200117144010.11149-1-ykaukab@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dynamic-funnel uses module_amba_driver to register. Whereas static-funnel 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 --- drivers/hwtracing/coresight/coresight-funnel.c | 30 ++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index 08d8f2b3565f..32cbf112ae34 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -342,7 +342,6 @@ static struct platform_driver static_funnel_driver = { .suppress_bind_attrs = true, }, }; -builtin_platform_driver(static_funnel_driver); static int dynamic_funnel_probe(struct amba_device *adev, const struct amba_id *id) @@ -373,7 +372,34 @@ static struct amba_driver dynamic_funnel_driver = { .probe = dynamic_funnel_probe, .id_table = dynamic_funnel_ids, }; -module_amba_driver(dynamic_funnel_driver); + +static int __init funnel_init(void) +{ + int ret; + + ret = platform_driver_register(&static_funnel_driver); + if (ret) { + pr_info("Error registering platform driver\n"); + return ret; + } + + ret = amba_driver_register(&dynamic_funnel_driver); + if (ret) { + pr_info("Error registering amba driver\n"); + platform_driver_unregister(&static_funnel_driver); + } + + return ret; +} + +static void __exit funnel_exit(void) +{ + platform_driver_unregister(&static_funnel_driver); + amba_driver_unregister(&dynamic_funnel_driver); +} + +module_init(funnel_init); +module_exit(funnel_exit); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("CoreSight Funnel driver"); -- 2.16.4