From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757171AbcAYOi1 (ORCPT ); Mon, 25 Jan 2016 09:38:27 -0500 Received: from lists.s-osg.org ([54.187.51.154]:46062 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756600AbcAYOhn (ORCPT ); Mon, 25 Jan 2016 09:37:43 -0500 From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Mark Brown , Matthias Brugger , Liam Girdwood , linux-mediatek@lists.infradead.org, John Crispin , linux-arm-kernel@lists.infradead.org, Javier Martinez Canillas Subject: [PATCH 2/2] regulator: mt6397: Add OF match table Date: Mon, 25 Jan 2016 11:37:16 -0300 Message-Id: <1453732637-20415-3-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453732637-20415-1-git-send-email-javier@osg.samsung.com> References: <1453732637-20415-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 The Documentation/devicetree/bindings/regulator/mt6397-regulator.txt doc mentions that a compatible "mediatek,mt6397-regulator" is required for the MT6397 device node but the driver doesn't provide a OF match table so the platform bus .match fallbacks to match using the driver name instead. This also means that module auto-loading is broken for this driver since the MFD driver that register the device, has a .of_compatible set so the platform .uevent callback reports a OF modalias that's not in the module. Signed-off-by: Javier Martinez Canillas --- drivers/regulator/mt6397-regulator.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/regulator/mt6397-regulator.c b/drivers/regulator/mt6397-regulator.c index 585f0399a36b..17a5b6c2d6a9 100644 --- a/drivers/regulator/mt6397-regulator.c +++ b/drivers/regulator/mt6397-regulator.c @@ -323,9 +323,16 @@ static const struct platform_device_id mt6397_platform_ids[] = { }; MODULE_DEVICE_TABLE(platform, mt6397_platform_ids); +static const struct of_device_id mt6397_of_match[] = { + { .compatible = "mediatek,mt6397-regulator", }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, mt6397_of_match); + static struct platform_driver mt6397_regulator_driver = { .driver = { .name = "mt6397-regulator", + .of_match_table = of_match_ptr(mt6397_of_match), }, .probe = mt6397_regulator_probe, .id_table = mt6397_platform_ids, -- 2.5.0