Re: [PATCH v4 2/9] w1_therm: fix reset_select_slave at beginning of search process

From: Akira shimahara
Date: Tue May 05 2020 - 17:06:38 EST


Le mardi 05 mai 2020 Ã 16:49 +0200, Greg KH a Ãcrit :
> > /*------------------------Hardware Functions---------------------
> > -----*/
> >
> > +/* Safe version of reser_select_slave - avoid using the one in
> > w_io.c */
> > +static int reset_select_slave(struct w1_slave *sl)
> > +{
> > + u8 match[9] = { W1_MATCH_ROM, };
> > + u64 rn = le64_to_cpu(*((u64 *)&sl->reg_num));
> > +
> > + if (w1_reset_bus(sl->master))
> > + return -ENODEV;
> > +
> > + memcpy(&match[1], &rn, 8);
> > + w1_write_block(sl->master, match, 9);
> > +
> > + return 0;
> > +}
>
>
> If you put this higher up in the .c file, no function definition is
>
> needed in the .h file at all, right?
>
>
>
> thanks,
>
>
>
> greg k-h

Yes, everything could be put in the .c file, but I think we will loose
clarity.
Please, let me know what you prefer.

Thanks

Akira Shimahara