]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/arm/mach-s3c2410/clock.c
[ARM] 3018/1: S3C2410 - check de-referenced device is really a platform device
[karo-tx-linux.git] / arch / arm / mach-s3c2410 / clock.c
index f59608268751f6769a920c49b73b75fa8ab1fce4..8b3d5dc35de58866dd7ddda31235ac1929c09437 100644 (file)
@@ -98,7 +98,10 @@ struct clk *clk_get(struct device *dev, const char *id)
        struct clk *clk = ERR_PTR(-ENOENT);
        int idno;
 
-       idno = (dev == NULL) ? -1 : to_platform_device(dev)->id;
+       if (dev == NULL || dev->bus != &platform_bus_type)
+               idno = -1;
+       else
+               idno = to_platform_device(dev)->id;
 
        down(&clocks_sem);