Re: [PATCH 1/2] driver core: remove device_add_attrs() in drivers/base/bus.c

Greg KH
2013-03-19T00:17:08Z

On Thu, Mar 07, 2013 at 10:22:45AM +0800, Wei Yang wrote:
> Originally, we have two functions named device_add_attrs() in
> drivers/base/bus.c and drivers/base/core.c. This will cause some confusion
> when reading the code.

Why? It's just static functions.

> And the one in drivers/base/bus.c do the same action as device_add_attributes()
> in drivers/base/core.c. That would be better to reuse this code.

Possibly, yes, but you put the .h entry in the wrong place, thereby
exposing a previously static function to the entire kernel, which is not
good at all. Why did you do that? Are you now going to want to call
that function from some driver?

greg k-h