Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935727AbcJQQOR (ORCPT ); Mon, 17 Oct 2016 12:14:17 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:36272 "EHLO s-opensource.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935589AbcJQQOA (ORCPT ); Mon, 17 Oct 2016 12:14:00 -0400 From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Javier Martinez Canillas , Ludovic Desroches , linux-mmc@vger.kernel.org, Adrian Hunter , Ulf Hansson Subject: [PATCH 2/2] mmc: sdhci-of-at91: Fix module autoload Date: Mon, 17 Oct 2016 13:13:45 -0300 Message-Id: <1476720825-30442-2-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476720825-30442-1-git-send-email-javier@osg.samsung.com> References: <1476720825-30442-1-git-send-email-javier@osg.samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1147 Lines: 37 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/mmc/host/sdhci-of-at91.ko | grep alias $ After this patch: $ modinfo drivers/mmc/host/sdhci-of-at91.ko | grep alias alias: of:N*T*Catmel,sama5d2-sdhciC* alias: of:N*T*Catmel,sama5d2-sdhci Signed-off-by: Javier Martinez Canillas --- drivers/mmc/host/sdhci-of-at91.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c index a9b7fc06c434..2f9ad213377a 100644 --- a/drivers/mmc/host/sdhci-of-at91.c +++ b/drivers/mmc/host/sdhci-of-at91.c @@ -100,6 +100,7 @@ static const struct of_device_id sdhci_at91_dt_match[] = { { .compatible = "atmel,sama5d2-sdhci", .data = &soc_data_sama5d2 }, {} }; +MODULE_DEVICE_TABLE(of, sdhci_at91_dt_match); #ifdef CONFIG_PM static int sdhci_at91_runtime_suspend(struct device *dev) -- 2.7.4