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]

 



Hello Sergei

On 12.02.2016 18:50, Sergei Shtylyov wrote:

+/* gets the "dr_mode" property from DT and converts it into musb_mode
+ * if the property is not found returns MUSB_UNDEFINED
+ */
+extern enum musb_mode musb_get_mode(struct device *dev);
+
+#if IS_ENABLED(CONFIG_OF)
+/* gets the "mentor,power" property from DT
+ * and converts it from mA to 2mA units for the "power" parameter
+ * in struct musb_hdrc_platform_data
+ *
+ * in case the property is not found returns 0
+ */
+extern u8 musb_get_power(struct device *dev);
+#else
+static inline u8 musb_get_power(struct device *dev)
+{
+    return 0;
+}
+#endif
+

Hm, do we need an empty implementation? In that case, I'd prefer to avoid #ifdef in musb_core.c...

I thought that could be useful, then the drivers wouldn't need to be polluted by #ifdef CONFIG_IF
But in this case it is anyway. Kind of...
What is the rule of thumb here?

Regards
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