Messages in this thread | | | Date | Mon, 10 Mar 2014 14:32:15 +0100 | From | Richard Cochran <> | Subject | Re: [PATCH RFC net-next v1 1/9] ptp: introduce programmable pins. |
| |
On Mon, Mar 10, 2014 at 12:53:09PM +0000, Sørensen, Stefan wrote: > On Sat, 2014-03-08 at 20:42 +0100, Richard Cochran wrote:
> > +int ptp_find_pin(struct ptp_clock *ptp, > > + enum ptp_pin_function func, unsigned int chan) > > +{ > > + struct ptp_pin_desc *pin = NULL; > > + int i; > > + > > + mutex_lock(&ptp->pincfg_mux); > > + for (i = 0; i < ptp->info->n_pins; i++) { > > + if (ptp->info->pin_config[i].func == func && > > + ptp->info->pin_config[i].chan == chan) { > > + pin = &ptp->info->pin_config[i]; > > + break; > > + } > > + } > > + mutex_unlock(&ptp->pincfg_mux); > > + > > + return pin ? pin - ptp->info->pin_config : -1; > > +} > > Maybe replace 'pin - ptp->info->pin_config' with 'i'?
Yes, of course.
Thanks, Richard -- 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/
| |