Re: [PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-17 Thread Vivien Didelot
Hi Guenter, > >>> switch (index) { > >>> +case 0: /* temp1_input */ > >>> +if (drv->get_temp) > >>> +mode |= S_IRUGO; > >> > >> This should be mandatory. Sorry, I don't really understand what you > >> are trying to accomplish here. > >> >

Re: [PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-17 Thread Vivien Didelot
Hi Guenter, switch (index) { +case 0: /* temp1_input */ +if (drv-get_temp) +mode |= S_IRUGO; This should be mandatory. Sorry, I don't really understand what you are trying to accomplish here. Can you give me a real world

Re: [PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-16 Thread Guenter Roeck
hi Vivien, On 04/16/2015 03:05 PM, Vivien Didelot wrote: Hi Guenter, switch (index) { +case 0: /* temp1_input */ +if (drv->get_temp) +mode |= S_IRUGO; This should be mandatory. Sorry, I don't really understand what you are trying to

Re: [PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-16 Thread Vivien Didelot
Hi Guenter, > > switch (index) { > > +case 0: /* temp1_input */ > > +if (drv->get_temp) > > +mode |= S_IRUGO; > > This should be mandatory. Sorry, I don't really understand what you are > trying to accomplish here. > > Can you give me a

Re: [PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-16 Thread Guenter Roeck
On Thu, Apr 16, 2015 at 02:38:19PM -0400, Vivien Didelot wrote: > A switch driver may only provide one of the temperature limit accessors, > or the temperature alarm getter. So register the hwmon subsystem if any > of the related functions is provided. > > Thus, check get_temp to set the

[PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-16 Thread Vivien Didelot
A switch driver may only provide one of the temperature limit accessors, or the temperature alarm getter. So register the hwmon subsystem if any of the related functions is provided. Thus, check get_temp to set the visibility of temp1_input. Signed-off-by: Vivien Didelot --- net/dsa/dsa.c | 7

Re: [PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-16 Thread Guenter Roeck
On Thu, Apr 16, 2015 at 02:38:19PM -0400, Vivien Didelot wrote: A switch driver may only provide one of the temperature limit accessors, or the temperature alarm getter. So register the hwmon subsystem if any of the related functions is provided. Thus, check get_temp to set the visibility of

Re: [PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-16 Thread Vivien Didelot
Hi Guenter, switch (index) { +case 0: /* temp1_input */ +if (drv-get_temp) +mode |= S_IRUGO; This should be mandatory. Sorry, I don't really understand what you are trying to accomplish here. Can you give me a real world

Re: [PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-16 Thread Guenter Roeck
hi Vivien, On 04/16/2015 03:05 PM, Vivien Didelot wrote: Hi Guenter, switch (index) { +case 0: /* temp1_input */ +if (drv-get_temp) +mode |= S_IRUGO; This should be mandatory. Sorry, I don't really understand what you are trying to

[PATCH 2/2] net: dsa: register hwmon for any provided function

2015-04-16 Thread Vivien Didelot
A switch driver may only provide one of the temperature limit accessors, or the temperature alarm getter. So register the hwmon subsystem if any of the related functions is provided. Thus, check get_temp to set the visibility of temp1_input. Signed-off-by: Vivien Didelot