On 11.02.2016 15:05, Sergei Shtylyov wrote:

+    int ret;
+    unsigned power_ma;
+
+    /* the "mentor,power" value is in milliamperes, whereas
+     * the mentor configuration is in 2mA units
+     */
+ ret = of_property_read_u32(dev->of_node, "mentor,power", &power_ma);
+
+    return ret ? 0 : power_ma / 2;

   You forgot to check for the maximum possible value (510).

Good point!

+}
+EXPORT_SYMBOL_GPL(musb_get_power);
+

[...]

Actually, we also have UDC specific 'min_power' field and a number of other fields (does it really work w/o specifying 'clock' BTW?). I'd suggest a larger function, assigning directly to the platform data fields...

Is there a property already defined for the min_power?

The clock doesn't seem to be used at all. Or did I miss something?

Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to