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: 10378401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0275060159 for ; Thu, 3 May 2018 13:41:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E467529167 for ; Thu, 3 May 2018 13:41:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8C3C29174; Thu, 3 May 2018 13:41:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4DD3B29167 for ; Thu, 3 May 2018 13:41:05 +0000 (UTC) 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-Google-Smtp-Source: AB8JxZqWfG+I94wpA/q9qr60SCSWOAbftT8XKbd4tIYcbzOZ2tvjhYdi317UP5IvONqK0nz/yVdygw== 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" X-Virus-Scanned: ClamAV using ClamSMTP 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