|
@@ -113,6 +113,12 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr
|
|
struct soc_device *soc_dev;
|
|
struct soc_device *soc_dev;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (!soc_bus_type.p) {
|
|
|
|
+ ret = bus_register(&soc_bus_type);
|
|
|
|
+ if (ret)
|
|
|
|
+ goto out1;
|
|
|
|
+ }
|
|
|
|
+
|
|
soc_dev = kzalloc(sizeof(*soc_dev), GFP_KERNEL);
|
|
soc_dev = kzalloc(sizeof(*soc_dev), GFP_KERNEL);
|
|
if (!soc_dev) {
|
|
if (!soc_dev) {
|
|
ret = -ENOMEM;
|
|
ret = -ENOMEM;
|
|
@@ -156,6 +162,9 @@ void soc_device_unregister(struct soc_device *soc_dev)
|
|
|
|
|
|
static int __init soc_bus_register(void)
|
|
static int __init soc_bus_register(void)
|
|
{
|
|
{
|
|
|
|
+ if (soc_bus_type.p)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
return bus_register(&soc_bus_type);
|
|
return bus_register(&soc_bus_type);
|
|
}
|
|
}
|
|
core_initcall(soc_bus_register);
|
|
core_initcall(soc_bus_register);
|