forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge patch series "can: remove litteral strings used for driver name…
…s and remove DRV_VERSION" Vincent Mailhol <[email protected]> says: ==================== This is a cleanup series. The patches 1 to 8 get rid of any hardcoded strings and instead relies on the KBUILD_MODNAME macros to get the device name. Patch 9 replaces the ES58X_MODULE_NAME macro with KBUILD_MODNAME in etas_es58x. Finally, also in etas_es58x, patch 10 removes the DRV_VERSION so that the module uses the default behavior and advertise the kernel version instead of a custom version. * Changelog * v1 -> v2: * The patch for esd_usb contained some changes for ems_usb. * v1 assumed that KBUILD_MODNAME could only be used when the file basename and the module had the same name (e.g. vcan.c for the vcan.ko). The fact is that KBUILD_NAME extends to the module name and can thus be used even if the basename is different (e.g. slcan-core.c and slcan.ko) * Add patch torvalds#9: can: etas_es58x: replace ES58X_MODULE_NAME with KBUILD_MODNAME v1: https://lore.kernel.org/all/[email protected] This series are the first 9 patches of: https://lore.kernel.org/linux-can/[email protected]/T/ The initial intent of those 9 patches was to do so cleanup in order to implement ethtool_ops::get_drvinfo but this appeared to be useless: https://lore.kernel.org/linux-can/[email protected]/ Instead, those patch are send as a standalone series. ==================== Drop "[PATCH v2 03/10] can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names" to avoid conflicts with Dario Binacchi's work on the slcan driver. Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
- Loading branch information
Showing
8 changed files
with
18 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* Fred N. van Kempen <[email protected]> | ||
*/ | ||
|
||
#define pr_fmt(fmt) "can327: " fmt | ||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
|
||
#include <linux/init.h> | ||
#include <linux/module.h> | ||
|
@@ -1100,7 +1100,7 @@ static int can327_ldisc_ioctl(struct tty_struct *tty, unsigned int cmd, | |
|
||
static struct tty_ldisc_ops can327_ldisc = { | ||
.owner = THIS_MODULE, | ||
.name = "can327", | ||
.name = KBUILD_MODNAME, | ||
.num = N_CAN327, | ||
.receive_buf = can327_ldisc_rx, | ||
.write_wakeup = can327_ldisc_tx_wakeup, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,11 @@ | |
|
||
#include "es58x_core.h" | ||
|
||
#define DRV_VERSION "1.00" | ||
MODULE_AUTHOR("Vincent Mailhol <[email protected]>"); | ||
MODULE_AUTHOR("Arunachalam Santhanam <[email protected]>"); | ||
MODULE_DESCRIPTION("Socket CAN driver for ETAS ES58X USB adapters"); | ||
MODULE_VERSION(DRV_VERSION); | ||
MODULE_LICENSE("GPL v2"); | ||
|
||
#define ES58X_MODULE_NAME "etas_es58x" | ||
#define ES58X_VENDOR_ID 0x108C | ||
#define ES581_4_PRODUCT_ID 0x0159 | ||
#define ES582_1_PRODUCT_ID 0x0168 | ||
|
@@ -59,11 +56,11 @@ MODULE_DEVICE_TABLE(usb, es58x_id_table); | |
|
||
#define es58x_print_hex_dump(buf, len) \ | ||
print_hex_dump(KERN_DEBUG, \ | ||
ES58X_MODULE_NAME " " __stringify(buf) ": ", \ | ||
KBUILD_MODNAME " " __stringify(buf) ": ", \ | ||
DUMP_PREFIX_NONE, 16, 1, buf, len, false) | ||
|
||
#define es58x_print_hex_dump_debug(buf, len) \ | ||
print_hex_dump_debug(ES58X_MODULE_NAME " " __stringify(buf) ": ",\ | ||
print_hex_dump_debug(KBUILD_MODNAME " " __stringify(buf) ": ",\ | ||
DUMP_PREFIX_NONE, 16, 1, buf, len, false) | ||
|
||
/* The last two bytes of an ES58X command is a CRC16. The first two | ||
|
@@ -2181,9 +2178,8 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf, | |
struct usb_endpoint_descriptor *ep_in, *ep_out; | ||
int ret; | ||
|
||
dev_info(dev, | ||
"Starting %s %s (Serial Number %s) driver version %s\n", | ||
udev->manufacturer, udev->product, udev->serial, DRV_VERSION); | ||
dev_info(dev, "Starting %s %s (Serial Number %s)\n", | ||
udev->manufacturer, udev->product, udev->serial); | ||
|
||
ret = usb_find_common_endpoints(intf->cur_altsetting, &ep_in, &ep_out, | ||
NULL, NULL); | ||
|
@@ -2280,7 +2276,7 @@ static void es58x_disconnect(struct usb_interface *intf) | |
} | ||
|
||
static struct usb_driver es58x_driver = { | ||
.name = ES58X_MODULE_NAME, | ||
.name = KBUILD_MODNAME, | ||
.probe = es58x_probe, | ||
.disconnect = es58x_disconnect, | ||
.id_table = es58x_id_table | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters