public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Matthew Frost <artusemrys@sbcglobal.net>
Cc: Arjan van de Ven <arjan@infradead.org>,
	Paul Sokolovsky <pmiscml@gmail.com>,
	Jiri Slaby <jirislaby@gmail.com>,
	linux-kernel@vger.kernel.org, Adrian Bunk <bunk@stusta.de>
Subject: Re: Where did find_bus() go in 2.6.18?
Date: Tue, 21 Nov 2006 22:01:50 +0300	[thread overview]
Message-ID: <20061121190150.GA25754@2ka.mipt.ru> (raw)
In-Reply-To: <4563457B.2070806@sbcglobal.net>

On Tue, Nov 21, 2006 at 12:29:15PM -0600, Matthew Frost (artusemrys@sbcglobal.net) wrote:
> So you have nested drivers.  The bottom driver (w1/slaves/w1_ds2760.c) talks to
> the hardware, and the top driver (misc/h2200_battery.c) interprets the output.
> You're dealing with a Dallas 1-Wire Bus protocol to talk to your battery
> management chip, which is a DS2760 High-Precision Li+ Battery Monitor.  You're
> telling us that h2200_battery uses find_bus() to locate the w1 bus and then the
> devices on that bus, so that it can use w1_ds2760 to read the chip.  So what is
> hanging you up here is that your top-level driver can't find the bus that the
> chip is on; once it can, everything should work?
> 
> The specific code:
> 
> void
> h2200_battery_probe_work(void *data)
> {
> 	struct bus_type *bus;
> 
> 	/* Get the battery w1 slave device. */
> 	bus = find_bus("w1");
> 	if (bus)
> 		ds2760_dev = bus_find_device(bus, NULL, NULL,
> 					     h2200_battery_match_callback);
> 
> 	if (!ds2760_dev) {
> 		/* No DS2760 device found; try again later. */
> 		queue_delayed_work(probe_q, &probe_work, HZ * 5);
> 		return;
> 	}
> }
> 
> What we need to do is help you find a better way to locate and identify a w1 device.
> 
> (cc: E. Polyakov for the w1 expertise)

Hello.

If find_bus() will not be resurrected, I can export w1_bus_type or
create special helpers to directly access w1 bus master devices.
But in that case there is no need to have all driver model in w1
subsystem at all...

> Matt

-- 
	Evgeniy Polyakov

  reply	other threads:[~2006-11-21 19:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-19 22:34 Where did find_bus() go in 2.6.18? Paul Sokolovsky
2006-11-19 23:45 ` Jiri Slaby
2006-11-20  0:12   ` Greg KH
2006-11-20 14:13     ` Re[2]: " Paul Sokolovsky
2006-11-20 17:35       ` Adrian Bunk
2006-11-21 15:08         ` Re[2]: " Paul Sokolovsky
2006-11-21 15:16           ` Arjan van de Ven
2006-11-21 18:04           ` Adrian Bunk
2006-11-21  7:54       ` Greg KH
2006-11-22  8:36         ` Re[2]: " Paul Sokolovsky
2006-11-21 19:02       ` Dmitry Torokhov
2006-11-20  0:13   ` Paul Sokolovsky
2006-11-20  8:34     ` Arjan van de Ven
2006-11-21 18:29       ` Matthew Frost
2006-11-21 19:01         ` Evgeniy Polyakov [this message]
2006-11-21 19:41           ` Re[2]: " Paul Sokolovsky
2006-11-21 20:34             ` Matthew Frost
2006-11-20  9:35 ` pHilipp Zabel
  -- strict thread matches above, loose matches on Subject: below --
2006-11-21 14:15 Al Boldi
2006-11-21 14:32 ` Arjan van de Ven
2006-11-22 14:18   ` Al Boldi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061121190150.GA25754@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=arjan@infradead.org \
    --cc=artusemrys@sbcglobal.net \
    --cc=bunk@stusta.de \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmiscml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox