summaryrefslogtreecommitdiff
path: root/drivers/bus/ifpga
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2018-09-26 00:02:20 +0200
committerThomas Monjalon <thomas@monjalon.net>2018-09-27 14:43:47 +0200
commit2ed055c5e32a39f5064639641f491e8a6839fe2d (patch)
tree3862a2fd74435a5b6fa72a2c27cc981324c2a017 /drivers/bus/ifpga
parent55d6bb67c9b3858b50df6c74a3b37d87b271a027 (diff)
downloaddpdk-2ed055c5e32a39f5064639641f491e8a6839fe2d.zip
dpdk-2ed055c5e32a39f5064639641f491e8a6839fe2d.tar.gz
dpdk-2ed055c5e32a39f5064639641f491e8a6839fe2d.tar.xz
bus/ifpga: remove useless driver cast
The rte_afu_driver is assigned to rte_afu_device.driver during probing. There is no need of accessing the rte_afu_driver via rte_device.driver and type casting to its container. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Rosen Xu <rosen.xu@intel.com>
Diffstat (limited to 'drivers/bus/ifpga')
-rw-r--r--drivers/bus/ifpga/ifpga_bus.c6
-rw-r--r--drivers/bus/ifpga/rte_bus_ifpga.h3
2 files changed, 2 insertions, 7 deletions
diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index b324872..c54b59d 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -347,16 +347,14 @@ static int
ifpga_remove_driver(struct rte_afu_device *afu_dev)
{
const char *name;
- const struct rte_afu_driver *driver;
name = rte_ifpga_device_name(afu_dev);
- if (!afu_dev->device.driver) {
+ if (afu_dev->driver == NULL) {
IFPGA_BUS_DEBUG("no driver attach to device %s\n", name);
return 1;
}
- driver = RTE_DRV_TO_AFU_CONST(afu_dev->device.driver);
- return driver->remove(afu_dev);
+ return afu_dev->driver->remove(afu_dev);
}
static int
diff --git a/drivers/bus/ifpga/rte_bus_ifpga.h b/drivers/bus/ifpga/rte_bus_ifpga.h
index 51d5ae0..d53c0f4 100644
--- a/drivers/bus/ifpga/rte_bus_ifpga.h
+++ b/drivers/bus/ifpga/rte_bus_ifpga.h
@@ -83,9 +83,6 @@ struct rte_afu_device {
#define RTE_DEV_TO_AFU(ptr) \
container_of(ptr, struct rte_afu_device, device)
-#define RTE_DRV_TO_AFU_CONST(ptr) \
- container_of(ptr, const struct rte_afu_driver, driver)
-
/**
* Initialization function for the driver called during FPGA BUS probing.
*/