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:
Josef Söntgen 2017-10-20 11:22:15 +02:00 committed by Christian Helmuth
parent 96351801c9
commit bc6f523c8d

View File

@ -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,
const struct resource *res,
unsigned int num)
@ -177,6 +182,8 @@ struct platform_device *platform_device_register_simple(const char *name, int id
if (!pdev)
return 0;
pdev->dev.bus = &platform_bus_type;
size_t len = strlen(name);
pdev->name = kzalloc(len + 1, GFP_KERNEL);
if (!pdev->name)