Per feedback from Marek, he suggested better handling and
to enable DM_FLAG_OS_PREPARE, this patch re-orders some of
the error checking, and errors returns the error code right
away and also sets DM_FLAG_OS_PREPARE.
Signed-off-by: Adam Ford <aford173@gmail.com>
err = 0;
priv->clock_count = 0;
clock_nb = dev_count_phandle_with_args(dev, "clocks", "#clock-cells");
+
+ if (clock_nb < 0)
+ return clock_nb;
+
if (clock_nb > 0) {
priv->clocks = devm_kcalloc(dev, clock_nb, sizeof(struct clk),
GFP_KERNEL);
}
priv->clock_count++;
}
- } else if (clock_nb != -ENOENT) {
- dev_err(dev, "failed to get clock phandle(%d)\n", clock_nb);
- return clock_nb;
}
err = usb_cpu_init();
.remove = ohci_da8xx_remove,
.ops = &ohci_usb_ops,
.priv_auto_alloc_size = sizeof(struct da8xx_ohci),
- .flags = DM_FLAG_ALLOC_PRIV_DMA,
+ .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_OS_PREPARE,
};
#endif