On 06/05/2018 11:21 AM, Wolfram Sang wrote:
> Hi Marek,
> 
> On Tue, Jun 05, 2018 at 10:07:28AM +0200, Simon Horman wrote:
>> On Mon, Jun 04, 2018 at 07:59:11PM +0200, Marek Vasut wrote:
>>> Rather than hard-coding the quirk topology, which stopped scaling,
>>> parse the information from DT. The code looks for all compatible
>>> PMICs -- da9036 and da9210 -- and checks if their IRQ line is tied
>>> to the same pin. If so, the code sends a matching sequence to the
>>> PMIC to deassert the IRQ.
>>>
>>> Signed-off-by: Marek Vasut <[email protected]>
>>> Cc: Geert Uytterhoeven <[email protected]>
>>> Cc: Kuninori Morimoto <[email protected]>
>>> Cc: Simon Horman <[email protected]>
>>> Cc: Wolfram Sang <[email protected]>
> 
> From an I2C point of view:
> 
> Acked-by: Wolfram Sang <[email protected]>
> 
> Minor nits:
> 
>>> @@ -122,7 +143,13 @@ static struct notifier_block regulator_quirk_nb = {
>>>  
>>>  static int __init rcar_gen2_regulator_quirk(void)
>>>  {
>>> -   u32 mon;
>>> +   struct device_node *np;
>>> +   const struct of_device_id *id;
>>> +   struct regulator_quirk *quirk;
>>> +   struct regulator_quirk *pos;
> 
> Merge the last two lines into one?
> 
>>> +   struct of_phandle_args *argsa, *argsb;
>>> +   u32 mon, addr;
>>> +   int ret;
>>>  
>>>     if (!of_machine_is_compatible("renesas,koelsch") &&
>>>         !of_machine_is_compatible("renesas,lager") &&
>>> @@ -130,6 +157,45 @@ static int __init rcar_gen2_regulator_quirk(void)
>>>         !of_machine_is_compatible("renesas,gose"))
>>>             return -ENODEV;
>>>  
>>> +   for_each_matching_node_and_match(np, rcar_gen2_quirk_match, &id) {
>>> +           if (!np || !of_device_is_available(np))
> 
> Can '!np' actually happen? This is the exit condition of the for-loop,
> or am I overlooking something?

I had to take a look again, no, it's not needed.

-- 
Best regards,
Marek Vasut

Reply via email to