On 20/05/16 12:59, Laxman Dewangan wrote:
+/* tegra_io_pads_config_info: Tegra IO pads bit config info.Comment coding style :-(
+ * @dpd_config_bit: DPD configuration bit position. -1 if not supported.
+ * @voltage_config_bit: Voltage configuration bit position. -1 if not supported.
+ * @soc_mask: Bitwise OR of SoC masks if IO pads supported on that SoC.
+ */
+static inline int tegra_io_pads_to_dpd_bit(const struct tegra_pmc_soc *soc,I realise now that we are not checking if 'id' is greater than
+ enum tegra_io_pads id)
{
- unsigned long rate, value;
+ if (tegra_io_pads_configs[id].soc_mask & soc->io_pads_soc_mask)
+ return tegra_io_pads_configs[id].dpd_config_bit;
TEGRA_IO_PADS_MAX anywhere. This should probably be handled here.
Yaah this is bug. should be if (ret < 32)Isn't bit always less than 32 here now?
+ int ret;
+
+ ret = tegra_io_pads_to_dpd_bit(pmc->soc, id);
+ if (ret < 0)
+ return ret;
+
+ *bit = ret % 32;
+
+ if (*bit < 32) {