lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE+NS36ZK2pq8CAcmiqiUf6Ph5RET5aO4nUPFUd-EDHVEuharA@mail.gmail.com>
Date:   Tue, 25 Aug 2020 17:13:43 +0800
From:   Gene Chen <gene.chen.richtek@...il.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Matthias Brugger <matthias.bgg@...il.com>, robh+dt@...nel.org,
        lgirdwood@...il.com, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org,
        Gene Chen <gene_chen@...htek.com>
Subject: Re: [PATCH v3 1/2] regulator: mt6360: Add support for MT6360 regulator

Mark Brown <broonie@...nel.org> 於 2020年8月24日 週一 下午7:05寫道:



>
> On Mon, Aug 24, 2020 at 06:23:19PM +0800, Gene Chen wrote:
> > Mark Brown <broonie@...nel.org> 於 2020年8月20日 週四 下午7:45寫道:
>
> > > This device only exists in the context of a single parent device, there
> > > should be no need for a compatible string here - this is just a detail
> > > of how Linux does things.  The MFD should just instntiate the platform
> > > device.
>
> > Trying to autoload module without of_id_table will cause run-time error:
> > ueventd: LoadWithAliases was unable to load
> > of:NregulatorT(null)Cmediatek,mt6360-regulator
>
> You shouldn't have this described in the device tree at all, like I say
> the MFD should just instantiate the platform device.

After I replace of_device_id by platform_device_id as below, I can
autoload module.
But I can't get of_node to parse init_data.
Should I use dev->parent->of_node and set
regulator_desc.regulator_node to parse each regulator definition in
device tree?

diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
index e995220..444dc8e 100644
--- a/drivers/mfd/mt6360-core.c
+++ b/drivers/mfd/mt6360-core.c
@@ -328,7 +328,7 @@ static const struct mfd_cell mt6360_devs[] = {
        OF_MFD_CELL("mt6360-led", mt6360_led_resources,
                    NULL, 0, 0, "mediatek,mt6360-led"),
        OF_MFD_CELL("mt6360-regulator", mt6360_regulator_resources,
-                   NULL, 0, 0, "mediatek,mt6360-regulator"),
+                   NULL, 0, 0, NULL),
        OF_MFD_CELL("mt6360-tcpc", NULL,
                    NULL, 0, 0, "mediatek,mt6360-tcpc"),
 };
diff --git a/drivers/regulator/mt6360-regulator.c
b/drivers/regulator/mt6360-regulator.c
index 97c16a2..d525bf1 100644
--- a/drivers/regulator/mt6360-regulator.c
+++ b/drivers/regulator/mt6360-regulator.c
@@ -438,11 +438,18 @@ static int mt6360_regulator_probe(struct
platform_device *pdev)
        return 0;
 }

+static const struct platform_device_id mt6360_regulator_id[] = {
+       { "mt6360-regulator", },
+       { },
+};
+MODULE_DEVICE_TABLE(platform, mt6360_regulator_id);
+
 static struct platform_driver mt6360_regulator_driver = {
        .driver = {
                .name = "mt6360-regulator",
        },
        .probe = mt6360_regulator_probe,
+       .id_table = mt6360_regulator_id,
 };

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ