[PATCH 04/13] soc: samsung: Add Exynos USI driver
Sam Protsenko
semen.protsenko at linaro.org
Thu Jan 11 02:25:21 CET 2024
On Wed, Dec 27, 2023 at 3:11 AM Minkyu Kang <promsoft at gmail.com> wrote:
>
> Hi
>
>
> 2023년 12월 13일 (수) 12:42, Sam Protsenko <semen.protsenko at linaro.org>님이 작성:
>>
[snip]
>> +
>> +/**
>> + * exynos_usi_set_sw_conf - Set USI block configuration mode
>> + * @usi: USI driver object
>> + * @mode: Mode index
>> + *
>> + * Select underlying serial protocol (UART/SPI/I2C) in USI IP-core.
>> + *
>> + * Return: 0 on success, or negative error code on failure.
>> + */
>> +static int exynos_usi_set_sw_conf(struct exynos_usi *usi, size_t mode)
>
>
> The value of mode is same as usi->mode, but is there a reason to pass it as a parameter?
>
>>
>> +{
>> + unsigned int val;
>> + int ret;
>> +
>> + if (mode < usi->data->min_mode || mode > usi->data->max_mode)
>> + return -EINVAL;
>> +
>> + val = exynos_usi_modes[mode].val;
>> + ret = regmap_update_bits(usi->sysreg, usi->sw_conf,
>> + usi->data->sw_conf_mask, val);
>> + if (ret)
>> + return ret;
>> +
>> + usi->mode = mode;
>
>
> This will obviously be the same value always.
>
Thanks for the review! Yes, you are right. This code was copy-pasted
from Linux kernel. So at the time I thought it was better to leave it
as is, for backporting reasons. But now that I look at it, this won't
be too helpful. So I'll get rid of it in v2.
[snip]
More information about the U-Boot
mailing list