diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 6ca7d8bfd..bf8e550c5 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -2357,7 +2357,13 @@ static void srpt_add_one(struct ib_device *device) #else sdev->dev.class = &srpt_class; sdev->dev.parent = device->dma_device; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30) snprintf(sdev->dev.bus_id, BUS_ID_SIZE, "srpt-%s", device->name); +#else + snprintf(sdev->init_name, sizeof(sdev->init_name), + "srpt-%s", device->name); + sdev->dev.init_name = sdev->init_name; +#endif #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) diff --git a/srpt/src/ib_srpt.h b/srpt/src/ib_srpt.h index 2212769e3..6a135e8c7 100644 --- a/srpt/src/ib_srpt.h +++ b/srpt/src/ib_srpt.h @@ -205,6 +205,9 @@ struct srpt_device { #else struct device dev; #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) + char init_name[20]; +#endif struct scst_tgt *scst_tgt; };