Messages in this thread |  | | Date | Fri, 16 Aug 2002 20:06:04 -0700 | From | Greg KH <> | Subject | Re: [PATCH] 2.5.31 driverfs: patch for your consideration |
| |
On Fri, Aug 16, 2002 at 10:36:00PM +0000, Adam Belay wrote: > Here's the patch as we discussed.
Um, your email client mangled the patch, dropping tabs and wrapped lines.
> +static ssize_t device_read_driver(struct device * dev, char * buf, > size_t count, loff_t off) > +{ > + if (dev->driver) > + return off ? 0 : sprintf(buf,"%s\n",dev->driver->name); > + else > + return 0; > +}
Isn't this info already in the "name" file of a driver?
> +struct device_driver * find_driver_by_name(struct bus_type * bus, char > * name) > +{ > + struct list_head * pos; > + struct device_driver * drv; > + list_for_each (pos, &bus->drivers) > + { > + drv = list_entry(pos, struct device_driver, bus_list); > + if (!strncmp(drv->name,name,strlen(name) - 1)) > + return drv; > + > + } > + return NULL; > + > +}
Not that I agree with this patch at all, but you might want to go read Documentation/CodingStyle to fix up your brace placement properly.
thanks,
greg k-h - 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/
|  |