From patchwork Wed Jan 25 13:38:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 9537063 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 073426046A for ; Wed, 25 Jan 2017 13:39:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDF4E281A7 for ; Wed, 25 Jan 2017 13:39:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2237281D2; Wed, 25 Jan 2017 13:39:15 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DB26281A7 for ; Wed, 25 Jan 2017 13:39:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbdAYNjN (ORCPT ); Wed, 25 Jan 2017 08:39:13 -0500 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:41634 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751445AbdAYNjN (ORCPT ); Wed, 25 Jan 2017 08:39:13 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 42246A12FC; Wed, 25 Jan 2017 13:39:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 39MiGVmDeTSa; Wed, 25 Jan 2017 13:39:24 +0000 (UTC) Received: from minerva.localdomain (unknown [181.121.136.80]) by osg.samsung.com (Postfix) with ESMTPSA id C36C0A0DE2; Wed, 25 Jan 2017 13:39:22 +0000 (UTC) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Javier Martinez Canillas , Sebastian Reichel , linux-pm@vger.kernel.org Subject: [PATCH] power: supply: max14656: Export I2C and OF device ID as module aliases Date: Wed, 25 Jan 2017 10:38:55 -0300 Message-Id: <1485351535-21066-1-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the driver is built as a module, I2C module alias information is not filled so the module won't be autoloaded. Export the I2C and OF devices ID to the module by using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/power/supply/max14656_charger_detector.ko | grep alias $ After this patch: $ modinfo drivers/power/supply/max14656_charger_detector.ko | grep alias alias: i2c:max14656 alias: of:N*T*Cmaxim,max14656C* alias: of:N*T*Cmaxim,max14656 Signed-off-by: Javier Martinez Canillas --- drivers/power/supply/max14656_charger_detector.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/power/supply/max14656_charger_detector.c b/drivers/power/supply/max14656_charger_detector.c index 80f8e5c1b4ec..b91b1d2999dc 100644 --- a/drivers/power/supply/max14656_charger_detector.c +++ b/drivers/power/supply/max14656_charger_detector.c @@ -305,11 +305,13 @@ static const struct i2c_device_id max14656_id[] = { { "max14656", 0 }, {} }; +MODULE_DEVICE_TABLE(i2c, max14656_id); static const struct of_device_id max14656_match_table[] = { { .compatible = "maxim,max14656", }, {} }; +MODULE_DEVICE_TABLE(of, max14656_match_table); static struct i2c_driver max14656_i2c_driver = { .driver = {