Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753485AbdFSTKt (ORCPT + 2 others); Mon, 19 Jun 2017 15:10:49 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:52347 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753429AbdFSSgm (ORCPT ); Mon, 19 Jun 2017 14:36:42 -0400 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: Javier Martinez Canillas , Greg Kroah-Hartman , Jiri Slaby , Willy Tarreau Subject: [PATCH 3.10 151/268] tty: serial: msm: Fix module autoload Date: Mon, 19 Jun 2017 20:30:50 +0200 Message-Id: <1497897167-14556-152-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1497897167-14556-1-git-send-email-w@1wt.eu> References: <1497897167-14556-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Javier Martinez Canillas commit abe81f3b8ed2996e1712d26d38ff6b73f582c616 upstream. If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/tty/serial/msm_serial.ko | grep alias $ After this patch: $ modinfo drivers/tty/serial/msm_serial.ko | grep alias alias: of:N*T*Cqcom,msm-uartdmC* alias: of:N*T*Cqcom,msm-uartdm alias: of:N*T*Cqcom,msm-uartC* alias: of:N*T*Cqcom,msm-uart Signed-off-by: Javier Martinez Canillas Acked-by: Bjorn Andersson Cc: stable Signed-off-by: Greg Kroah-Hartman Signed-off-by: Jiri Slaby Signed-off-by: Willy Tarreau --- drivers/tty/serial/msm_serial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index b11e997..876ce88 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -930,6 +930,7 @@ static struct of_device_id msm_match_table[] = { { .compatible = "qcom,msm-uart" }, {} }; +MODULE_DEVICE_TABLE(of, msm_match_table); static struct platform_driver msm_platform_driver = { .remove = msm_serial_remove, -- 2.8.0.rc2.1.gbe9624a