Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222249

Re: [PATCH v4 04/22] of: add function to allow probing a device from a OF node

From Tomeu Vizoso <tomeu.vizoso@collabora.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 04/22] of: add function to allow probing a device from a OF node
Date 2015-09-10 17:00 +0200
Message-ID <q7buq-4DO-23@gated-at.bofh.it> (permalink)
References <q63IB-5sL-5@gated-at.bofh.it> <q63IB-5sL-3@gated-at.bofh.it> <q6GqC-2fO-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 9 September 2015 at 03:29, Rob Herring <robh@kernel.org> wrote:
> On 09/07/2015 07:23 AM, Tomeu Vizoso wrote:
>> Walks the OF tree up and finds the closest ancestor that has a struct
>> device associated with it, probing it if isn't bound to a driver yet.
>>
>> The above should ensure that the dependency represented by the passed OF
>> node is available, because probing a device should cause its descendants
>> to be probed as well (when they get registered).
>>
>> Subsystems can use this when looking up resources for drivers, to reduce
>> the chances of deferred probes because of the probing order of devices.
>>
>> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>
> Looks pretty good to me. One comment below.
>
> [...]
>
>> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
>> index baf04d7249bd..f089d95ac961 100644
>> --- a/drivers/of/platform.c
>> +++ b/drivers/of/platform.c
>> @@ -269,6 +269,8 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
>>               goto err_free;
>>       }
>>
>> +     node->device = &dev->dev;
>> +
>
> This seems oddly placed. Can you move to patch 3?

Sure, no problem. Besides this, are you ok with the rest of the series?

Regards,

Tomeu

>>       return dev;
>>
>>  err_free:
>> diff --git a/include/linux/of_device.h b/include/linux/of_device.h
>> index cc7dd687a89d..da8d489e73ad 100644
>> --- a/include/linux/of_device.h
>> +++ b/include/linux/of_device.h
>> @@ -40,6 +40,7 @@ extern ssize_t of_device_get_modalias(struct device *dev,
>>
>>  extern void of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
>>  extern int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env);
>> +extern void of_device_probe(struct device_node *np);
>>
>>  static inline void of_device_node_put(struct device *dev)
>>  {
>> @@ -84,6 +85,8 @@ static inline int of_device_uevent_modalias(struct device *dev,
>>       return -ENODEV;
>>  }
>>
>> +static inline void of_device_probe(struct device_node *np) { }
>> +
>>  static inline void of_device_node_put(struct device *dev) { }
>>
>>  static inline const struct of_device_id *__of_match_device(
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 04/22] of: add function to allow probing a device from a OF node Tomeu Vizoso <tomeu.vizoso@collabora.com> - 2015-09-07 14:30 +0200
  Re: [PATCH v4 04/22] of: add function to allow probing a device from  a OF node Rob Herring <robh@kernel.org> - 2015-09-09 07:50 +0200
    Re: [PATCH v4 04/22] of: add function to allow probing a device from  a OF node Tomeu Vizoso <tomeu.vizoso@collabora.com> - 2015-09-10 17:00 +0200
  Re: [PATCH v4 04/22] of: add function to allow probing a device from  a OF node Mark Brown <broonie@kernel.org> - 2015-09-11 14:10 +0200
    Re: [PATCH v4 04/22] of: add function to allow probing a device from  a OF node Tomeu Vizoso <tomeu.vizoso@collabora.com> - 2015-09-16 10:20 +0200
      Re: [PATCH v4 04/22] of: add function to allow probing a device from  a OF node Mark Brown <broonie@kernel.org> - 2015-09-16 21:40 +0200

csiph-web