提交 d24b2898 编写于 作者: T Thierry Reding

gpu: host1x: Fix a few sparse warnings

Include the bus.h header, so that various function declarations are
visible in the source file that implements those functions. This keeps
sparse from suggesting that they should be made static.

Make the host1x_bus_type variable static since it isn't used globally.

Finally replace the slightly unsafe dev_set_name(dev, name) by the more
secure dev_set_name(dev, "%s", name).
Signed-off-by: NThierry Reding <treding@nvidia.com>
上级 9ab34151
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/slab.h> #include <linux/slab.h>
#include "bus.h"
#include "dev.h" #include "dev.h"
static DEFINE_MUTEX(clients_lock); static DEFINE_MUTEX(clients_lock);
...@@ -257,7 +258,7 @@ static int host1x_unregister_client(struct host1x *host1x, ...@@ -257,7 +258,7 @@ static int host1x_unregister_client(struct host1x *host1x,
return -ENODEV; return -ENODEV;
} }
struct bus_type host1x_bus_type = { static struct bus_type host1x_bus_type = {
.name = "host1x", .name = "host1x",
}; };
...@@ -301,7 +302,7 @@ static int host1x_device_add(struct host1x *host1x, ...@@ -301,7 +302,7 @@ static int host1x_device_add(struct host1x *host1x,
device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask;
device->dev.dma_mask = &device->dev.coherent_dma_mask; device->dev.dma_mask = &device->dev.coherent_dma_mask;
device->dev.release = host1x_device_release; device->dev.release = host1x_device_release;
dev_set_name(&device->dev, driver->name); dev_set_name(&device->dev, "%s", driver->name);
device->dev.bus = &host1x_bus_type; device->dev.bus = &host1x_bus_type;
device->dev.parent = host1x->dev; device->dev.parent = host1x->dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册