Skip to contentSkip to conversation

dev_printk() is now GPL-only

DISCUSSION Matthew Wilcox 2 participants 3 messages Aug 7, 2006 – Sep 24, 2006 Driver core

lore
Share & tools
lore
#0 lore raw

Does dev_driver_string() really need to be GPL-only? Up to this point, proprietary modules have been entitled to call dev_printk(), but now:

#define dev_printk(level, dev, format, arg...)  \
        printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)

with

EXPORT_SYMBOL_GPL(dev_driver_string);

means that they're not allowed to.

On a related note, one might wonder if

        return dev->driver ? dev->driver->name :
	                        (dev->bus ? dev->bus->name : "");

really qualifies for the full weight of copyright enforcement, and query whether using it makes your driver a derived work. Particularly since all one is doing is asking the kernel for a nice printk prefix and know nothing about the innards of the device model.

#1 lore raw
Quoted 4 lines · Matthew Wilcox

Does dev_driver_string() really need to be GPL-only? Up to this point, proprietary modules have been entitled to call dev_printk(), but now:

Quoted 8 lines
#define dev_printk(level, dev, format, arg...)  \
        printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)

with

EXPORT_SYMBOL_GPL(dev_driver_string);

means that they're not allowed to.

Oops, good point, I never noticed, as I don't have an closed source drivers here to test with :)

Care to send me a patch to fix it up?

thanks,

greg k-h

#2 lore raw
Quoted 1 line · Greg KH

Care to send me a patch to fix it up?

Sorry for the delay ...

Make dev_printk usable from non-GPL modules again

dev_printk now calls dev_driver_string. We want even proprietary modules to be calling dev_printk, so the export of dev_driver_string needs to be non-GPL-only.

drivers/base/core.c +1 -1
index be6b5bc..426be09 100644
@@ -42,7 +42,7 @@ const char *dev_driver_string(struct dev
 	return dev->driver ? dev->driver->name :
 			(dev->bus ? dev->bus->name : "");
 }
-EXPORT_SYMBOL_GPL(dev_driver_string);
+EXPORT_SYMBOL(dev_driver_string);
 
 #define to_dev(obj) container_of(obj, struct device, kobj)
 #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)