Re: [PATCH 2/5] usb: musb: core: added helper functions for parsing DT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux