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: 12837755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2F7CC433F5 for ; Wed, 4 May 2022 11:41:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D4B2C10F826; Wed, 4 May 2022 11:41:33 +0000 (UTC) Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by gabe.freedesktop.org (Postfix) with ESMTPS id C613810F826 for ; Wed, 4 May 2022 11:41:32 +0000 (UTC) Received: by mail-pl1-x630.google.com with SMTP id j8so1157267pll.11 for ; Wed, 04 May 2022 04:41:32 -0700 (PDT) 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:content-transfer-encoding; bh=zroNIHNyi1xhWUCjMbfGRAX1xVgB1APMgcHSCv64Dcg=; b=GAMchdnOFVBu8MgxuMIcwfoun7timH2lhBD9bi3n1IOZVh9J/WFY63YoebZLARAICK AYqUsCFqKufuSUa14TOerRFX5LcMhnoqguVXcfZtFOoxVYHHExRug9CDoW1Ax0QNtxk+ utEfgZ4g9oFV6hnVUFHf1qb1Tohxqtu2Oj6SA= 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:content-transfer-encoding; bh=zroNIHNyi1xhWUCjMbfGRAX1xVgB1APMgcHSCv64Dcg=; b=XXh2wUQY+jGlOYw8DSLPiUzNRaEbw+cLDU2Mgd5eXUC00N69ml0fLkxK0Pl8HdEBq1 QIdAqbWqi+EgN0AVS4yTplPsgLV2LiWeWPim2FMk8t3qSqmEstRvW4AwAe076j0ChYXW tB4gwNx+6bdIw2g494JMBHx1Sjzxhq5sPyzwrV5PiRVpHTNUkSr1HEFUg3gZE5H+rpAp gWBvFOF0PlN3EW9Htt01l+JBC9d7E+uiAKGdEwT8INmU3VPk1FwLbdYGPdoyk70W0lHu n6aTJXEn2jCcxOt0AERFkacrVMMMMl+WA5ZIoi6dtOBRPLXO5mUUzOztAhToSUQVkwZ3 4ZJA== X-Gm-Message-State: AOAM532CuZ2UA2F7qj4EXIUQUPd9LJpGBFLi7j1WaebZ+paMGJddqv8A PTLjRQ5gwQoMv+Nlb3JTXWh1Mw== X-Google-Smtp-Source: ABdhPJwEaGjX3j/RzoSectesepakk+UomwdKFJ3YD/G3W/8jIvtg0/ahYwC1KyfyV4iEoDGRkcuAnw== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Matteo Lisi , dri-devel@lists.freedesktop.org, NXP Linux Team , linux-amarula , linux-arm-kernel@lists.infradead.org, Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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");