From patchwork Thu May 3 13:40:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 134903 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1942003lji; Thu, 3 May 2018 06:41:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqD4EDXhVCYgpQn9QAKq1FO2EaTLqvCgliF2tTNftEgcZlSoP2II8vOnUwVxoYOaoru4j5j X-Received: by 2002:a17:902:145:: with SMTP id 63-v6mr24085040plb.332.1525354865149; Thu, 03 May 2018 06:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525354865; cv=none; d=google.com; s=arc-20160816; b=XkhwK8DMGE4WzbL+Jw5FiA5Gw8GNIkSm1N7FEQtTzEmN8o4ofADbTAl6vmq0kOR6/R t468CQ1rPbFfabNNCDWxelSvNVwH7IyFAKXvi5FClQSAkiofn4zrRjJvm08Yrzv82sGo DCiC4oCG3C0FIcmYriYbYBZxDPDhJmccH/1Z+SZmGb8oblouaih34aW9xgZEE/qoIkSr RtE8MEzLNMJHq4THvyntTXXDy8Mh2HcZUedCxOLC6HOEumMyiXbcnQSQ/qVVlgii/SkE bT6jNOO2WO8j38PIU0/RBfgAIjx2vk9N2OnxgAksl5IEexCgKtlrdqcgUZBvCwAbv1G8 bXdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=u6p5jmnQo6qqOmXXWrpLDzx3R6xHJjlDNgQisHS/LtM=; b=WyXCrr0xfhcIixnFODKAdbqdPuXF+cZUW5FvtjC/ZFFm9xH+44b9VEfW88ElPJkwza /4r87LGSiATLbI3SWUysBJpg8vZTQEL0HgFeaa+cWub8au3a6k4TqifXZfeYaQkvSFsb gO8plGMHWCr+JydIV/XcYfOLu/+rA37ncsE+eSLbBJWGuc8lAaUpXdVRNA5bwnga8tvV /jld5muwmJAUBnfzbQgfiEBRxzylQrLS97WngXgRHVQ20iYhzrCAkzigjhpCwRBVER5c rCRyTGviyMkx6RFOfVMCY432yo+T4ORZLbZeEzMOwxUe3dtZ3c6KtZXSKZ2EdXvmPLu8 YPSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QJN5Yw4h; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id a6-v6si13478426plz.49.2018.05.03.06.41.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 06:41:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QJN5Yw4h; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 005FA6E635; Thu, 3 May 2018 13:41:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id E2AF46E635 for ; Thu, 3 May 2018 13:41:01 +0000 (UTC) Received: by mail-lf0-x242.google.com with SMTP id m18-v6so26053250lfb.0 for ; Thu, 03 May 2018 06:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=A4ZoslBF0xY5JcYtcXivkOVrK4a0XILBF6yvDGGs8PA=; b=QJN5Yw4hbGAb+BPYrt5uWXoKm6vWXj0UHDq6Jm+deofUhHjaFJN4P5e3X/HAAs89+d 5Yu0495fSLVsUJz1/xxhvOJG13kx35UmUW7UmvJ8bqfuJF7t8fRbcHqky2ebE2UhYo0R E8ht2AG2NvZJWgEYpOEX9eixVqEAmZFlAs09o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=A4ZoslBF0xY5JcYtcXivkOVrK4a0XILBF6yvDGGs8PA=; b=WN5m8OXofO3Di8uI2T1EBOcBUqvuQkZX7VnhBGvwaTmXPF4dSPkcvVruJH23ybysCx CXe6QzMD7cT7f7yzwj6HJsRqykDUQQ4MOJoc8uU+jN3a/uALNS0kQaicV9EqR6aUws5C iJW07320IvyIFx/ToxL7/3Toggg6TgxXdjugW72ah0ZVSY5rUS/B8C6jig/utcEskWLg yoHIcP7Oe6wKwqW9/v+JnSxYga1QkvhHE+u1mI3E40aPB97OLUOjFsFPedUvPWk5uw9C PbNAWWEt1Hfm241BL4+Ya7wTmb36j8C3hcxoOHqx/KNyPJUzfGi9Cwt67RXKJ/43AewH sKFQ== X-Gm-Message-State: ALQs6tCyZtUorvDrWnSA3WQo0IxtfDJ8hIhBkdKsEdAPpP9f44j9yx1y pYtt5/l2Zif2gDzGUdu59kog3Q== X-Received: by 2002:a2e:165a:: with SMTP id 26-v6mr12223665ljw.16.1525354860181; Thu, 03 May 2018 06:41:00 -0700 (PDT) Received: from genomnajs.wlan.se.axis.com ([85.235.16.11]) by smtp.gmail.com with ESMTPSA id c26-v6sm2872896lfh.25.2018.05.03.06.40.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 06:40:59 -0700 (PDT) From: Linus Walleij To: Gustavo Padovan , Maarten Lankhorst , Sean Paul , Eric Anholt , Liviu Dudau Subject: [PATCH] drm/pl111: Fix module probe bug Date: Thu, 3 May 2018 15:40:53 +0200 Message-Id: <20180503134053.24945-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robin Murphy , Pawel Moll , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Commit a30933c27602 ("drm/pl111: Support the Versatile Express") Added a second module using the builtin_platform_driver() call, which works fine as long as you do not try to build the PL111 driver as a module, because a module can only have one initcall and cause the following build bug: (...) multiple definition of `init_module' (...) Reported-by: Daniel Vetter Cc: Liviu Dudau Cc: Pawel Moll Cc: Eric Anholt Cc: Robin Murphy Fixes: a30933c27602 ("drm/pl111: Support the Versatile Express") Signed-off-by: Linus Walleij Reviewed-by: Daniel Vetter --- drivers/gpu/drm/pl111/pl111_versatile.c | 7 +++++++ drivers/gpu/drm/pl111/pl111_vexpress.c | 5 ++++- drivers/gpu/drm/pl111/pl111_vexpress.h | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c index 78ddf8534fd2..2f0daab30973 100644 --- a/drivers/gpu/drm/pl111/pl111_versatile.c +++ b/drivers/gpu/drm/pl111/pl111_versatile.c @@ -326,6 +326,13 @@ int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv) if (versatile_clcd_type == VEXPRESS_CLCD_V2M) { struct platform_device *pdev; + /* Registers a driver for the muxfpga */ + ret = vexpress_muxfpga_init(); + if (ret) { + dev_err(dev, "unable to intialized muxfpga driver\n"); + return ret; + } + /* Call into deep Vexpress configuration API */ pdev = of_find_device_by_node(np); if (!pdev) { diff --git a/drivers/gpu/drm/pl111/pl111_vexpress.c b/drivers/gpu/drm/pl111/pl111_vexpress.c index c9fee625faf1..508878c9bd52 100644 --- a/drivers/gpu/drm/pl111/pl111_vexpress.c +++ b/drivers/gpu/drm/pl111/pl111_vexpress.c @@ -122,4 +122,7 @@ static struct platform_driver vexpress_muxfpga_driver = { .probe = vexpress_muxfpga_probe, }; -builtin_platform_driver(vexpress_muxfpga_driver); +int vexpress_muxfpga_init(void) +{ + return platform_driver_register(&vexpress_muxfpga_driver); +} diff --git a/drivers/gpu/drm/pl111/pl111_vexpress.h b/drivers/gpu/drm/pl111/pl111_vexpress.h index 49876417f7b6..40fbe42369dc 100644 --- a/drivers/gpu/drm/pl111/pl111_vexpress.h +++ b/drivers/gpu/drm/pl111/pl111_vexpress.h @@ -10,6 +10,8 @@ int pl111_vexpress_clcd_init(struct device *dev, struct pl111_drm_dev_private *priv, struct regmap *map); +int vexpress_muxfpga_init(void); + #else static int inline pl111_vexpress_clcd_init(struct device *dev, @@ -19,4 +21,9 @@ static int inline pl111_vexpress_clcd_init(struct device *dev, return -ENODEV; } +static inline int vexpress_muxfpga_init(void) +{ + return 0; +} + #endif