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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201302191049.31327.arnd@arndb.de>
Date:	Tue, 19 Feb 2013 10:49:31 +0000
From:	Arnd Bergmann <arnd@...db.de>
To:	Alexander Shiyan <shc_work@...l.ru>
Cc:	Dong Aisheng <dong.aisheng@...aro.org>,
	linux-kernel@...r.kernel.org, Samuel Ortiz <sameo@...ux.intel.com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: Re: Re[2]: [PATCH v3] mfd: syscon: Add non-DT support

On Tuesday 19 February 2013, Alexander Shiyan wrote:
> Hello.
> 
> Strange, but I not received an original answer from Arnd, have only this mail.

I got a reject notice from mail.ru, which apparently didn't like the
SMTP server of my German ISP. I already tried to resend my mail to you,
and now try to send it out through the gmail server. Please let me know
if you get it.

> > >> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> > >> index 4a7ed5a..3c0abcb 100644
> > >> --- a/drivers/mfd/syscon.c
> > >> +++ b/drivers/mfd/syscon.c
> > >
> > > Hi Alexander,
> > >
> > >>  struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
> > >>  {
> > >>       struct device_node *syscon_np;
> > >>       struct regmap *regmap;
> > >> +     struct syscon *syscon;
> > >> +     struct device *dev;
> > >>
> > >>       syscon_np = of_find_compatible_node(NULL, NULL, s);
> > >> -     if (!syscon_np)
> > >> +     if (syscon_np) {
> > >> +             regmap = syscon_node_to_regmap(syscon_np);
> > >> +             of_node_put(syscon_np);
> > >> +
> > >> +             return regmap;
> > >> +     }
> > >> +
> > >> +     /* Fallback to search by id_entry.name string */
> > >> +     dev = driver_find_device(&syscon_driver.driver, NULL, (void *)s,
> > >> +                              syscon_match_id);
> > >> +     if (!dev)
> > >>               return ERR_PTR(-ENODEV);
> > >>
> > >> -     regmap = syscon_node_to_regmap(syscon_np);
> > >> -     of_node_put(syscon_np);
> > >> +     syscon = dev_get_drvdata(dev);
> > >>
> > >> -     return regmap;
> > >> +     return syscon->regmap;
> > >>  }
> > >>  EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_compatible);
> > >
> > > Since you are not actually comparing the "compatible" property here,
> > > I would suggest adding another function here,
> > 
> > Yes, i also think like that.
> 
> In this case we should provide two paths for drivers which can work as with DT
> and without DT. In my case we can use platform_device_id.name field with
> "compatible" string. My way in this case is transparency for driver which is
> using "syscon".

But drivers should use the _by_phandle variant normally, which does
not work without DT, so you already have separate code paths.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ