[RESEND4] Dallas 1-wire protocol implementation.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 03, 2004 at 12:30:32AM +0400, Evgeniy Polyakov wrote:
> On Sun, 20 Jun 2004 16:51:31 +0400
> Evgeniy Polyakov <johnpol at 2ka.mipt.ru> wrote:
> 
> Ping.
> iButton support will coming soon.

Ok, sorry for the long delay.

I finally commited this patch, along with a bunch of minor cleanups:
	- small formatting ones (took the extra " " out before the "("
	  in a function call)
	- made some global symbols have a "w1" in them (like "flock")

And then I disabled this whole function:

> +ssize_t w1_master_attribute_show (struct device *dev, char *buf)
> +{
> +	struct w1_master *md = container_of (dev, struct w1_master, dev);
> +	int c = PAGE_SIZE;
> +
> +	if (down_interruptible (&md->mutex))
> +		return -EBUSY;
> +
> +	c -= snprintf (buf + PAGE_SIZE - c, c, "%s\n", md->name);
> +	c -= snprintf (buf + PAGE_SIZE - c, c,
> +		       "bus_master=0x%p, timeout=%d, max_slave_count=%d, attempts=%lu\n",
> +		       md->bus_master, w1_timeout, md->max_slave_count,
> +		       md->attempts);
> +	c -= snprintf (buf + PAGE_SIZE - c, c, "%d slaves: ",
> +		       md->slave_count);
> +	if (md->slave_count == 0)
> +		c -= snprintf (buf + PAGE_SIZE - c, c, "no.\n");
> +	else {
> +		struct list_head *ent, *n;
> +		struct w1_slave *sl;
> +
> +		list_for_each_safe (ent, n, &md->slist) {
> +			sl = list_entry (ent, struct w1_slave, w1_slave_entry);
> +
> +			c -= snprintf (buf + PAGE_SIZE - c, c, "%s[%p] ",
> +				       sl->name, sl);
> +		}
> +		c -= snprintf (buf + PAGE_SIZE - c, c, "\n");
> +	}
> +
> +	up (&md->mutex);
> +
> +	return PAGE_SIZE - c;
> +}

As sysfs files should be 1 value per file.  If you want to output a
whole bunch of info, you need to make a whole bunch of files.

I've added the patch to my bk trees, and it should show up in the next
-mm release.  If you need a copy of the patch I've applied, so that you
can send me updates and you don't want to mess with bitkeeper, please
let me know and I'll send it to you.

Oh heck, I've put it here for everyone to see, to make it easier:
	www.kernel.org/pub/linux/people/gregkh/i2c/2.6/2.6.7/w1-2.6.7.patch

thanks, and again, sorry for the delay.

greg k-h



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux