]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/chipidea/core.c
Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[karo-tx-linux.git] / drivers / usb / chipidea / core.c
index 9e217b1361ea76af9b9a5bb999b81559643e8e25..fe4fe24407296d52ba28a0408e39ba131b4e3737 100644 (file)
@@ -843,7 +843,10 @@ static ssize_t ci_role_show(struct device *dev, struct device_attribute *attr,
 {
        struct ci_hdrc *ci = dev_get_drvdata(dev);
 
-       return sprintf(buf, "%s\n", ci_role(ci)->name);
+       if (ci->role != CI_ROLE_END)
+               return sprintf(buf, "%s\n", ci_role(ci)->name);
+
+       return 0;
 }
 
 static ssize_t ci_role_store(struct device *dev,