wifi: initialize 'struct device' member properly
Normally this is done in 'platform_device_add()' but let's do it in our 'platform_device_register_simple()' implementation.
This commit is contained in:
parent
96351801c9
commit
bc6f523c8d
|
@ -169,6 +169,11 @@ int platform_device_add_resources(struct platform_device *pdev,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct bus_type platform_bus_type = {
|
||||||
|
.name = "platform"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
struct platform_device *platform_device_register_simple(const char *name, int id,
|
struct platform_device *platform_device_register_simple(const char *name, int id,
|
||||||
const struct resource *res,
|
const struct resource *res,
|
||||||
unsigned int num)
|
unsigned int num)
|
||||||
|
@ -177,6 +182,8 @@ struct platform_device *platform_device_register_simple(const char *name, int id
|
||||||
if (!pdev)
|
if (!pdev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
pdev->dev.bus = &platform_bus_type;
|
||||||
|
|
||||||
size_t len = strlen(name);
|
size_t len = strlen(name);
|
||||||
pdev->name = kzalloc(len + 1, GFP_KERNEL);
|
pdev->name = kzalloc(len + 1, GFP_KERNEL);
|
||||||
if (!pdev->name)
|
if (!pdev->name)
|
||||||
|
|
Loading…
Reference in New Issue