staging: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9f37952aa0
commit
e913397202
@@ -2534,7 +2534,7 @@ static int at76_init_new_device(struct at76_priv *priv,
|
|||||||
|
|
||||||
dev_info(dev, "%s: USB %s, MAC %s, firmware %d.%d.%d-%d\n",
|
dev_info(dev, "%s: USB %s, MAC %s, firmware %d.%d.%d-%d\n",
|
||||||
wiphy_name(priv->hw->wiphy),
|
wiphy_name(priv->hw->wiphy),
|
||||||
interface->dev.bus_id, mac2str(priv->mac_addr),
|
dev_name(&interface->dev), mac2str(priv->mac_addr),
|
||||||
priv->fw_version.major, priv->fw_version.minor,
|
priv->fw_version.major, priv->fw_version.minor,
|
||||||
priv->fw_version.patch, priv->fw_version.build);
|
priv->fw_version.patch, priv->fw_version.build);
|
||||||
dev_info(dev, "%s: regulatory domain 0x%02x: %s\n",
|
dev_info(dev, "%s: regulatory domain 0x%02x: %s\n",
|
||||||
|
@@ -1321,7 +1321,7 @@ static int __devinit poch_pci_probe(struct pci_dev *pdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = request_irq(pdev->irq, poch_irq_handler, IRQF_SHARED,
|
ret = request_irq(pdev->irq, poch_irq_handler, IRQF_SHARED,
|
||||||
dev->bus_id, poch_dev);
|
dev_name(dev), poch_dev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "error requesting IRQ %u\n", pdev->irq);
|
dev_err(dev, "error requesting IRQ %u\n", pdev->irq);
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
@@ -91,5 +91,5 @@ void stub_rx_loop(struct usbip_task *);
|
|||||||
void stub_enqueue_ret_unlink(struct stub_device *, __u32, __u32);
|
void stub_enqueue_ret_unlink(struct stub_device *, __u32, __u32);
|
||||||
|
|
||||||
/* stub_main.c */
|
/* stub_main.c */
|
||||||
int match_busid(char *busid);
|
int match_busid(const char *busid);
|
||||||
void stub_device_cleanup_urbs(struct stub_device *sdev);
|
void stub_device_cleanup_urbs(struct stub_device *sdev);
|
||||||
|
@@ -389,7 +389,7 @@ static int stub_probe(struct usb_interface *interface,
|
|||||||
{
|
{
|
||||||
struct usb_device *udev = interface_to_usbdev(interface);
|
struct usb_device *udev = interface_to_usbdev(interface);
|
||||||
struct stub_device *sdev = NULL;
|
struct stub_device *sdev = NULL;
|
||||||
char *udev_busid = interface->dev.parent->bus_id;
|
const char *udev_busid = dev_name(interface->dev.parent);
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
dev_dbg(&interface->dev, "Enter\n");
|
dev_dbg(&interface->dev, "Enter\n");
|
||||||
|
@@ -40,11 +40,12 @@ struct kmem_cache *stub_priv_cache;
|
|||||||
* remote host.
|
* remote host.
|
||||||
*/
|
*/
|
||||||
#define MAX_BUSID 16
|
#define MAX_BUSID 16
|
||||||
static char busid_table[MAX_BUSID][BUS_ID_SIZE];
|
#define BUSID_SIZE 20
|
||||||
|
static char busid_table[MAX_BUSID][BUSID_SIZE];
|
||||||
static spinlock_t busid_table_lock;
|
static spinlock_t busid_table_lock;
|
||||||
|
|
||||||
|
|
||||||
int match_busid(char *busid)
|
int match_busid(const char *busid)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ int match_busid(char *busid)
|
|||||||
|
|
||||||
for (i = 0; i < MAX_BUSID; i++)
|
for (i = 0; i < MAX_BUSID; i++)
|
||||||
if (busid_table[i][0])
|
if (busid_table[i][0])
|
||||||
if (!strncmp(busid_table[i], busid, BUS_ID_SIZE)) {
|
if (!strncmp(busid_table[i], busid, BUSID_SIZE)) {
|
||||||
/* already registerd */
|
/* already registerd */
|
||||||
spin_unlock(&busid_table_lock);
|
spin_unlock(&busid_table_lock);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -92,7 +93,7 @@ static int add_match_busid(char *busid)
|
|||||||
|
|
||||||
for (i = 0; i < MAX_BUSID; i++)
|
for (i = 0; i < MAX_BUSID; i++)
|
||||||
if (!busid_table[i][0]) {
|
if (!busid_table[i][0]) {
|
||||||
strncpy(busid_table[i], busid, BUS_ID_SIZE);
|
strncpy(busid_table[i], busid, BUSID_SIZE);
|
||||||
spin_unlock(&busid_table_lock);
|
spin_unlock(&busid_table_lock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -109,9 +110,9 @@ static int del_match_busid(char *busid)
|
|||||||
spin_lock(&busid_table_lock);
|
spin_lock(&busid_table_lock);
|
||||||
|
|
||||||
for (i = 0; i < MAX_BUSID; i++)
|
for (i = 0; i < MAX_BUSID; i++)
|
||||||
if (!strncmp(busid_table[i], busid, BUS_ID_SIZE)) {
|
if (!strncmp(busid_table[i], busid, BUSID_SIZE)) {
|
||||||
/* found */
|
/* found */
|
||||||
memset(busid_table[i], 0, BUS_ID_SIZE);
|
memset(busid_table[i], 0, BUSID_SIZE);
|
||||||
spin_unlock(&busid_table_lock);
|
spin_unlock(&busid_table_lock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -125,19 +126,19 @@ static ssize_t store_match_busid(struct device_driver *dev, const char *buf,
|
|||||||
size_t count)
|
size_t count)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
char busid[BUS_ID_SIZE];
|
char busid[BUSID_SIZE];
|
||||||
|
|
||||||
if (count < 5)
|
if (count < 5)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* strnlen() does not include \0 */
|
/* strnlen() does not include \0 */
|
||||||
len = strnlen(buf + 4, BUS_ID_SIZE);
|
len = strnlen(buf + 4, BUSID_SIZE);
|
||||||
|
|
||||||
/* busid needs to include \0 termination */
|
/* busid needs to include \0 termination */
|
||||||
if (!(len < BUS_ID_SIZE))
|
if (!(len < BUSID_SIZE))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
strncpy(busid, buf + 4, BUS_ID_SIZE);
|
strncpy(busid, buf + 4, BUSID_SIZE);
|
||||||
|
|
||||||
|
|
||||||
if (!strncmp(buf, "add ", 4)) {
|
if (!strncmp(buf, "add ", 4)) {
|
||||||
|
@@ -157,7 +157,7 @@ static int tweak_set_configuration_cmd(struct urb *urb)
|
|||||||
* A user may need to set a special configuration value before
|
* A user may need to set a special configuration value before
|
||||||
* exporting the device.
|
* exporting the device.
|
||||||
*/
|
*/
|
||||||
uinfo("set_configuration (%d) to %s\n", config, urb->dev->dev.bus_id);
|
uinfo("set_configuration (%d) to %s\n", config, dev_name(&urb->dev->dev));
|
||||||
uinfo("but, skip!\n");
|
uinfo("but, skip!\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -175,7 +175,7 @@ static int tweak_reset_device_cmd(struct urb *urb)
|
|||||||
value = le16_to_cpu(req->wValue);
|
value = le16_to_cpu(req->wValue);
|
||||||
index = le16_to_cpu(req->wIndex);
|
index = le16_to_cpu(req->wIndex);
|
||||||
|
|
||||||
uinfo("reset_device (port %d) to %s\n", index, urb->dev->dev.bus_id);
|
uinfo("reset_device (port %d) to %s\n", index, dev_name(&urb->dev->dev));
|
||||||
|
|
||||||
/* all interfaces should be owned by usbip driver, so just reset it. */
|
/* all interfaces should be owned by usbip driver, so just reset it. */
|
||||||
ret = usb_lock_device_for_reset(urb->dev, NULL);
|
ret = usb_lock_device_for_reset(urb->dev, NULL);
|
||||||
|
@@ -1091,7 +1091,7 @@ static int vhci_hcd_probe(struct platform_device *pdev)
|
|||||||
* Allocate and initialize hcd.
|
* Allocate and initialize hcd.
|
||||||
* Our private data is also allocated automatically.
|
* Our private data is also allocated automatically.
|
||||||
*/
|
*/
|
||||||
hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, pdev->dev.bus_id);
|
hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev));
|
||||||
if (!hcd) {
|
if (!hcd) {
|
||||||
uerr("create hcd failed\n");
|
uerr("create hcd failed\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@@ -60,7 +60,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr,
|
|||||||
out += sprintf(out, "%03u %08x ",
|
out += sprintf(out, "%03u %08x ",
|
||||||
vdev->speed, vdev->devid);
|
vdev->speed, vdev->devid);
|
||||||
out += sprintf(out, "%16p ", vdev->ud.tcp_socket);
|
out += sprintf(out, "%16p ", vdev->ud.tcp_socket);
|
||||||
out += sprintf(out, "%s", vdev->udev->dev.bus_id);
|
out += sprintf(out, "%s", dev_name(&vdev->udev->dev));
|
||||||
|
|
||||||
} else
|
} else
|
||||||
out += sprintf(out, "000 000 000 0000000000000000 0-0");
|
out += sprintf(out, "000 000 000 0000000000000000 0-0");
|
||||||
|
Reference in New Issue
Block a user