From patchwork Thu Mar 5 14:06:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walter Lozano X-Patchwork-Id: 243227 List-Id: U-Boot discussion From: walter.lozano at collabora.com (Walter Lozano) Date: Thu, 5 Mar 2020 11:06:21 -0300 Subject: [RFC] dm: uclass: add functions to get device by platdata In-Reply-To: References: <20200304194006.30924-1-walter.lozano@collabora.com> Message-ID: <81657eea-7215-3a7e-f6fa-1ddce4eb2c11@collabora.com> Hi Simon, On 5/3/20 10:54, Walter Lozano wrote: > Let me check if I understand correctly, your suggestion is to do > something like diff --git a/include/dm/uclass.h b/include/dm/uclass.h > index 92c07f8426..bf09dadf3f 100644 --- a/include/dm/uclass.h +++ > b/include/dm/uclass.h > > @@ -167,8 +167,8 @@ int uclass_get_device(enum uclass_id id, int > index, struct udevice **devp); > > ?int uclass_get_device_by_name(enum uclass_id id, const char *name, > ????????????????????????????? struct udevice **devp); -int > uclass_get_device_by_platdata(enum uclass_id id, void *platdata, > -???????????????????????????? struct udevice **devp); > > +int uclass_get_device_by_struct(enum uclass_id id, enum dm_struct_t > struct_id, +???????????????????????????? void *struct_pointer, struct > udevice **devp); ?/** ? * uclass_get_device_by_seq() - Get a uclass > device based on an ID and sequence ? * > > If that is the case, I would be happy to help. > > Also, if my understanding is correct, could you elaborate which cases > are you trying to cover with this approach? Sorry, it looks like the last part of the email test got screw. If I understand correctly, your suggestion is to change If that is the case, I would be happy to help. Also, if my understanding is correct, could you elaborate which cases are trying to cover with this approach? Regards, Walter diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 92c07f8426..bf09dadf3f 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -167,8 +167,8 @@ int uclass_get_device(enum uclass_id id, int index, struct udevice **devp); int uclass_get_device_by_name(enum uclass_id id, const char *name, struct udevice **devp); -int uclass_get_device_by_platdata(enum uclass_id id, void *platdata, - struct udevice **devp); +int uclass_get_device_by_struct(enum uclass_id id, enum dm_struct_t , struct_id, + void *struct_pointer, struct udevice **devp); /** * uclass_get_device_by_seq() - Get a uclass device based on an ID and sequence *