Re: [PATCH v9 5/5] iio: osf: add UART IIO driver
From: Andy Shevchenko
Date: Thu Sep 10 2026 - 04:11:20 EST
On Wed, Sep 09, 2026 at 10:06:58AM -0500, Jinseob Kim wrote:
> Add the Open Sensor Fusion serdev transport and runtime IIO registration
> from capability reports. Configure UART before enabling vcc, and retain
> early capabilities until the remaining probe setup succeeds.
>
> Use initialized aligned scan storage, pack active channels, and quiesce
> pushes before buffer reconfiguration. Only accepted samples update the
> latest-sample cache used by direct reads.
>
> Include KUnit coverage for cache integrity, scan bytes and timestamps,
> buffer lifetime, and early capability ownership.
Too big to review, should be split to at least 3 patches (rule of thumb:
each patch rarely should go above ~750 LoC).
...
> + baudrate = serdev_device_set_baudrate(serdev, OSF_SERDEV_BAUD);
> + if (baudrate != OSF_SERDEV_BAUD)
> + dev_warn(dev, "requested %u baud, controller set %u\n",
> + OSF_SERDEV_BAUD, baudrate);
dev_warn_probe()
> + serdev_device_set_flow_control(serdev, false);
> +
> + ret = regulator_enable(vcc);
> + if (ret) {
> + dev_err_probe(dev, ret, "failed to enable vcc regulator\n");
> + goto err_close;
> + }
> +
> + ret = devm_add_action_or_reset(dev, osf_serdev_disable_vcc, vcc);
> + if (ret)
> + goto err_close;
Something went wrong. It's supposed to be no goto:s after devm_*().
> +
> + /* No fallible probe steps remain when IIO children become visible. */
> + scoped_guard(mutex, &osf_uart->rx_lock)
> + osf_core_start(&osf_uart->osf);
> +
> + return 0;
> +
> +err_close:
> + serdev_device_close(serdev);
> + osf_stream_reset(&osf_uart->stream);
> + osf_core_unregister_iio(&osf_uart->osf);
> +
> + return ret;
> +}
--
With Best Regards,
Andy Shevchenko