Re: [PATCH v4 01/11] libnvdimm: Replace namespace_match() with device_find_child_by_name()

Zijun Hu <[email protected]>
Newsgroups gmane.linux.ports.sparc,gmane.linux.kernel,gmane.linux.sound,gmane.linux.block,gmane.linux.kernel.firewire.devel,gmane.linux.kernel.efi,gmane.linux.kernel.gpio,gmane.comp.video.dri.devel,gmane.linux.ports.arm.mediatek,gmane.linux.kernel.hwmon,gmane.linux.drivers.video-input-infrastructure,gmane.linux.pwm,gmane.linux.scsi,gmane.linux.usb.general,gmane.linux.serial,gmane.linux.network
Message-ID <[email protected]>
On 2025/1/3 02:17, Fan Ni wrote:
>> -
>>  static bool is_idle(struct device *dev, struct nd_namespace_common *ndns)
>>  {
>>  	struct nd_region *nd_region = to_nd_region(dev->parent);
>> @@ -168,7 +161,7 @@ ssize_t nd_namespace_store(struct device *dev,
>>  		goto out;
>>  	}
>>  
>> -	found = device_find_child(dev->parent, name, namespace_match);
>> +	found = device_find_child_by_name(dev->parent, name);
> Looks good to me.
> Just one general question.
> The function device_find_child checks parent and parent->p, but
> device_find_child_by_name only checks parent although they share the
> code except the match function. Why that?
> 

Thank you Fan for code review.

I did not touch device_find_child_by_name() parameter checking at
that time.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=903c44939abc02e2f3d6f2ad65fa090f7e5df5b6

since
[PATCH v5 05/12] will come finally.
https://lore.kernel.org/all/[email protected]/


> Fan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.