LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/8] remove "#if 0" from find_bus function, export it.
@ 2007-05-03 21:31 Anton Vorontsov
  2007-05-03 23:14 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Vorontsov @ 2007-05-03 21:31 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, kernel-discuss, David Woodhouse

This function were placed in "#if 0" because nobody was using it.
We using it now.

See http://lwn.net/Articles/210610/

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
---
 drivers/base/bus.c     |    5 ++---
 include/linux/device.h |    2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 253868e..971efa2 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -667,14 +667,13 @@ void put_bus(struct bus_type * bus)
  *
  *	Note that kset_find_obj increments bus' reference count.
  */
-#if 0
+
 struct bus_type * find_bus(char * name)
 {
 	struct kobject * k = kset_find_obj(&bus_subsys.kset, name);
 	return k ? to_bus(k) : NULL;
 }
-#endif  /*  0  */
-
+EXPORT_SYMBOL_GPL(find_bus);
 
 /**
  *	bus_add_attrs - Add default attributes for this bus.
diff --git a/include/linux/device.h b/include/linux/device.h
index 5cf30e9..4015b39 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -68,6 +68,8 @@ extern void bus_unregister(struct bus_type * bus);
 
 extern int __must_check bus_rescan_devices(struct bus_type * bus);
 
+extern struct bus_type *find_bus(char *name);
+
 /* iterator helpers for buses */
 
 int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
-- 
1.5.1.1-dirty


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/8] remove "#if 0" from find_bus function, export it.
  2007-05-03 21:31 [PATCH 1/8] remove "#if 0" from find_bus function, export it Anton Vorontsov
@ 2007-05-03 23:14 ` Greg KH
  2007-05-04  0:21   ` Anton Vorontsov
  2007-05-04 11:18   ` [Kernel-discuss] " Paul Sokolovsky
  0 siblings, 2 replies; 4+ messages in thread
From: Greg KH @ 2007-05-03 23:14 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linux-kernel, kernel-discuss, David Woodhouse

On Fri, May 04, 2007 at 01:31:21AM +0400, Anton Vorontsov wrote:
> This function were placed in "#if 0" because nobody was using it.
> We using it now.

Why?  Shouldn't you just export the pointer you need instead?

> See http://lwn.net/Articles/210610/

I don't understand the need for this link, it talks about how the api
changes all the time, something we all know :)

And if you really want it, and you convince me you really need it, can
you change it to be "bus_find" to play nicer in the namespace?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/8] remove "#if 0" from find_bus function, export it.
  2007-05-03 23:14 ` Greg KH
@ 2007-05-04  0:21   ` Anton Vorontsov
  2007-05-04 11:18   ` [Kernel-discuss] " Paul Sokolovsky
  1 sibling, 0 replies; 4+ messages in thread
From: Anton Vorontsov @ 2007-05-04  0:21 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, kernel-discuss, David Woodhouse

On Thu, May 03, 2007 at 04:14:59PM -0700, Greg KH wrote:
> On Fri, May 04, 2007 at 01:31:21AM +0400, Anton Vorontsov wrote:
> > This function were placed in "#if 0" because nobody was using it.
> > We using it now.
> 
> Why?  Shouldn't you just export the pointer you need instead?

We can do one way or another. We can ask W1 bus maintainer to
export bus type. Or we can un-"if 0" generic find_bus/bus_find
function.

> And if you really want it, and you convince me you really need it,

No, I don't want it at all. But ds2760_battery driver need to find
w1 bus type.

A long time ago in a Galaxy far far away we're used to find_bus
function, then it was removed, and somewhere in the thread I gave
link to, someone suggested to show real user of that function and
post that patch. I've just done that.

So, if you're unwilling to revert that function, please say it
explicitly, and I'll ping w1 folks to export bus type.

I really-really don't care how exactly we should find that
bus stuff.

> thanks,
> 
> greg k-h

Good luck,

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.org/bd2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Kernel-discuss] Re: [PATCH 1/8] remove "#if 0" from find_bus function, export it.
  2007-05-03 23:14 ` Greg KH
  2007-05-04  0:21   ` Anton Vorontsov
@ 2007-05-04 11:18   ` Paul Sokolovsky
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Sokolovsky @ 2007-05-04 11:18 UTC (permalink / raw)
  To: Greg KH; +Cc: Anton Vorontsov, David Woodhouse, linux-kernel, kernel-discuss

Hello Greg,

Friday, May 4, 2007, 2:14:59 AM, you wrote:

> On Fri, May 04, 2007 at 01:31:21AM +0400, Anton Vorontsov wrote:
>> This function were placed in "#if 0" because nobody was using it.
>> We using it now.

> Why?  Shouldn't you just export the pointer you need instead?

>> See http://lwn.net/Articles/210610/

> I don't understand the need for this link, it talks about how the api
> changes all the time, something we all know :)

        No, it talked about how complete APIs regress into random
set of functions, lacking complete coverage of target domain. The
response was that when users for the specific function in question
will be in mainline, it will be resurrected. So, here it comes ;-)

> And if you really want it, and you convince me you really need it, can
> you change it to be "bus_find" to play nicer in the namespace?

> thanks,

> greg k-h


-- 
Best regards,
 Paul                            mailto:pmiscml@gmail.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-04 11:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-03 21:31 [PATCH 1/8] remove "#if 0" from find_bus function, export it Anton Vorontsov
2007-05-03 23:14 ` Greg KH
2007-05-04  0:21   ` Anton Vorontsov
2007-05-04 11:18   ` [Kernel-discuss] " Paul Sokolovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).