[U-Boot] [PATCH 1/2] SPI: Add i.MX ECSPI driver

Fabio Estevam festevam at gmail.com
Thu Jan 12 16:40:24 CET 2012


On Thu, Jan 12, 2012 at 1:27 PM, Dirk Behme <dirk.behme at de.bosch.com> wrote:

> +static s32 spi_reset(struct spi_slave *slave)
> +{
> +       u32 clk_src = mxc_get_clock(MXC_CSPI_CLK);
> +       u32 pre_div = 0, post_div = 0, reg_ctrl, reg_config;
> +       struct imx_spi_dev_t *dev = to_imx_spi_slave(slave);
> +       struct spi_reg_t *reg = &(dev->reg);
> +
> +       if (dev->freq == 0) {
> +               printf("Error: desired clock is 0\n");
> +               return 1;

I think that returning a negative error code, such as -EINVAL would be
better here.

Regards,

Fabio Estevam


More information about the U-Boot mailing list