From patchwork Wed May 4 11:40:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1936 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8D1B33F067 for ; Wed, 4 May 2022 13:41:34 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id r204-20020a632bd5000000b003c1720b306bsf621464pgr.8 for ; Wed, 04 May 2022 04:41:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651664493; cv=pass; d=google.com; s=arc-20160816; b=OQVfjNmdZHJ2tBRekiEyOnQeFt8eX+iNU3hQKlSj41d+jZP0RyKOjQbcNm9TPbDMks ZOWKyrbrrNT/yBIfyLChdn7T9lcV2RglNNUiF9UBZJxyKdWC4HDtNrpvdWn4nuy2C3NL oJgtkE2HahwKTdvoMcZs8u8UYmzYHhjVznVSqgHaL6elmDFyKxHqfjrX0XhSnLOhWPFu lpkC7veLxhQfxx+gaa0bgYazGpBE29qqZmXGccFPJ3Ry+kwQwlj7ZWwvwvBR+5l78x2z 9HSheYHYobgSw4ChxMHW3kjG3pPk78rRQS43I1tmmnH7zRHmGixgzYqU6eqBU/1UWtcq c8Pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=nJ/5AytwQP4xpJfai7hf7UHs/GiYAfMN64g4kU+wrTs=; b=kc5FHVllq5lZQGKFfr9D6JiO1EToEKk3FN9mbDCsKmv8bwFiPraXtGybpvm2oYBKSk uwN6U4FucnJUSRplYCgN8ZQoPsZB5TNSDYzeRchWJUwtweQhQqgBZeDlFSGtiS/k94pt MyFmNyTsJduTBiX9ESCRRibTCMjIPLx46V49I3GzaqX1A55lBSseKeiE3BCDwHmkcazx wCK6j0U4ncSL706nbGL6QqYE7NQhYeCdCnSvAIYp5J7AS+m9BOiT5mcPPEDdIo4DHG/Y C+eU4sayIu8nE2H7KWxDPfhNCCUIyO4KJx9yxWuYWQEkTKYwZt3onZk1AwUXg+fxl8cJ 2L1w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GAMchdnO; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=nJ/5AytwQP4xpJfai7hf7UHs/GiYAfMN64g4kU+wrTs=; b=LXVTMdNuyckZsdzTuqfNMoloXhcDNcrJm0xzCZjcdyk6HI19hgOSAxgwI299gBklNJ xS9/jML7s7tVQEP2PK9ZIqrQmInGNoTA9HBV/hKugDsapcqiWDfwUaId/PH9bvKWC8jh x0sG49/vMrK15D7o/FqZTgyRhODgmpxoYFPrE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=nJ/5AytwQP4xpJfai7hf7UHs/GiYAfMN64g4kU+wrTs=; b=eqfbaUIjQ1/Dgoypij7yizkfIy7i2QXeaNLlK/mPlVllkH6CpsmGqjMPAdJCwi0Bx2 skzvOq1gVtszWXR0WvuwLKgh2f8os80drj/G24TRtvjnD1w/ygZPIgJpGiPF6Kj8OcUb M6E6WmCuemn/iUQNh4+7QGAwiY+OXDoxBbqApoSzx/j+H9ghqvkNzbpvGRS0b8gCCz+c nNS1nZ9KoMldXZX7foc0Vz7pon6l4BY+Wo1l9xX0NcU7F0UqauY5gmZOXe+GMSAPyapj 1gxirIdTOYP/7X1C9rdujl2TAUemFBLlIiYFa0wEshYvS0va5TZMf3YXsrmsvWVtBiQb dewg== X-Gm-Message-State: AOAM530KAg6nw2Hhrpu4mhCPbtTOOdb9S7blPOaSoG3xr8LcWodeYOAR m4l2hf8ZsaN1w0p3dD7SIXTNdo/m X-Google-Smtp-Source: ABdhPJxmsJPjSUFGi0KtFsFU2spsUvKa7hEJK0NHKfpKEQg2aDqiD0ShJgEUrqE7+T1WrcEC8kEHNw== X-Received: by 2002:a63:d505:0:b0:3c2:5a75:47f6 with SMTP id c5-20020a63d505000000b003c25a7547f6mr8848073pgg.170.1651664493378; Wed, 04 May 2022 04:41:33 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d2ca:b0:15e:bde6:299d with SMTP id n10-20020a170902d2ca00b0015ebde6299dls1197385plc.0.gmail; Wed, 04 May 2022 04:41:32 -0700 (PDT) X-Received: by 2002:a17:90a:fc8a:b0:1d8:ace3:70bc with SMTP id ci10-20020a17090afc8a00b001d8ace370bcmr9945450pjb.37.1651664492677; Wed, 04 May 2022 04:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651664492; cv=none; d=google.com; s=arc-20160816; b=FIIe4NR3cpXR1le+Cb3W5LY64FQJi5ufq+D/eRR84EcMY7g3DF+wvNBzYwKu/jJS3u VTnoGYUDedFl/QfNOWd2Fly9CnDx5+Gtk+l21aa6g+Sk223D+2SQhQDCIWHeAm/lhNZV lPr9QXfnh1p8YJnInYN3zygQtKWhK8XzQ62q2DJmk593S7KGCvQgj2nJ2CXe/c0gTfKt JPpPwHcvhHo749jcee0F681VMqXMlo1Y/K3h6MiNgQzKXfxcSUi+h7/3nEKfX6E7TOZ6 rz9S5bIekwxKs7KhHd6dWHGuXsi2fVCerOubFlL186DXfQON+m5rfjZLbRB5FWu4UQhR du7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=zroNIHNyi1xhWUCjMbfGRAX1xVgB1APMgcHSCv64Dcg=; b=ZDOV6lcnjxzy2ynWpsCcMYxIyiJx/4oWxiuNXB6AbXm3kjzDdL0Vbm+8sSdOB8Zbpu NnMD1FgVzPjxks3NiwRUlf2ADuReFxkih8qk6BhGRJsq/O4CkUywQBebB0LPCSgSdnbw C7/S/aDHR7By3SqGL7BpEGcWGDfEOZLlNCXDetj6uzgqAR2g6hwqrxUzywMusq0uIE3m 6dWq1Vn8T9d1Vb6I6jfRRWE85stPo1k433SqVs/UapsbxnxK5d4JlgHWhvG6bBCvjyrG wA5tFbp/n5gCZr5VVCljHt17aIyrtYY7xo5239hn4s9OCdsa0xnwA4/IEG6dTh9OOLFE GQZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GAMchdnO; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id s34-20020a17090a2f2500b001dc96ab224esor829903pjd.33.2022.05.04.04.41.32 for (Google Transport Security); Wed, 04 May 2022 04:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:90a:fa97:b0:1dc:2805:9b0a with SMTP id cu23-20020a17090afa9700b001dc28059b0amr9700771pjb.85.1651664492362; Wed, 04 May 2022 04:41:32 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41:31 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v2 07/12] drm: bridge: samsung-dsim: Add module init, exit Date: Wed, 4 May 2022 17:10:16 +0530 Message-Id: <20220504114021.33265-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GAMchdnO; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add module init and exit functions for the bridge to register and unregister dsi_driver. Exynos drm driver stack will register the platform_driver separately in the common of it's exynos_drm_drv.c including dsi_driver. Register again would return -EBUSY, so return 0 for such cases as dsi_driver is already registered. v2, v1: * none Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 8f9ae16d45bc..b618e52d0ee3 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1740,6 +1740,28 @@ struct platform_driver dsi_driver = { }, }; +static int __init samsung_mipi_dsim_init(void) +{ + int ret; + + ret = platform_driver_register(&dsi_driver); + + /** + * Exynos drm driver stack will register the platform_driver + * separately in the common of it's exynos_drm_drv.c including + * dsi_driver. Register again would return -EBUSY, so return 0 + * for such cases as dsi_driver is already registered. + */ + return ret == -EBUSY ? 0 : ret; +} +module_init(samsung_mipi_dsim_init); + +static void __exit samsung_mipi_dsim_exit(void) +{ + platform_driver_unregister(&dsi_driver); +} +module_exit(samsung_mipi_dsim_exit); + MODULE_AUTHOR("Jagan Teki "); MODULE_DESCRIPTION("Samsung MIPI DSIM controller bridge"); MODULE_LICENSE("GPL");