linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Public ridicule due to sound/soc/soc-core.c abuse of the driver model
@ 2012-01-06 19:40 Greg KH
  2012-01-06 20:15 ` Mark Brown
  2012-01-06 20:31 ` Mark Brown
  0 siblings, 2 replies; 15+ messages in thread
From: Greg KH @ 2012-01-06 19:40 UTC (permalink / raw)
  To: Frank Mandarino, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: Russell King, alsa-devel, linux-kernel

Hi Frank, Liam, and sound maintainers.

It was recently pointed out to me that the sound/soc/soc-core.c is
flagrantly abusing the driver model by providing "empty" release
functions, just to keep the kernel from complaining:

/* stop no dev release warning */
static void soc_ac97_device_release(struct device *dev){}

....

static void rtd_release(struct device *dev) {}


As per the documentation in the kernel tree[1], I now get to publicly
mock you for thinking you know better than the driver model.

Come on people, do you think that I wrote the code in the kernel that
produces those errors just for fun?  It was telling you to fix your code
by providing a function to free the structure that is being released,
not to try to trick the kernel because you think you know better.  The
kernel was trying to help you out here, to get the programming model
correct, in a place that was commonly misunderstood.

But, by you trying to be "smart", you just proved that your code was
incorrect and buggy.

Please fix this for the 3.3 kernel release.

Yes, I know it's been there for a number of years, but that still
doesn't make it correct.  Especially as stuff like this tends to get
cut-and-pasted over time.

thanks,

greg k-h

[1] Documentation/kobject.txt

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

end of thread, other threads:[~2012-01-09 23:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-06 19:40 Public ridicule due to sound/soc/soc-core.c abuse of the driver model Greg KH
2012-01-06 20:15 ` Mark Brown
2012-01-06 20:50   ` Russell King - ARM Linux
2012-01-06 21:10     ` Russell King - ARM Linux
2012-01-06 23:41     ` Mark Brown
2012-01-06 23:44       ` Russell King - ARM Linux
2012-01-06 23:49         ` Mark Brown
2012-01-09  9:51           ` Russell King - ARM Linux
2012-01-09 19:52             ` Mark Brown
2012-01-09 20:11               ` Greg KH
2012-01-09 20:31                 ` Mark Brown
2012-01-09 21:37                   ` Russell King - ARM Linux
2012-01-09 22:16                     ` Mark Brown
2012-01-09 23:02                   ` Greg KH
2012-01-06 20:31 ` Mark Brown

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).