All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Markus Probst" <markus.probst@posteo.de>
Cc: dri-devel@lists.freedesktop.org, ojeda@kernel.org
Subject: Re: [PATCH v15 2/3] samples: rust: add Rust serial device bus sample device driver
Date: Sat, 18 Jul 2026 14:40:27 +0000	[thread overview]
Message-ID: <20260718144027.BCFF41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260718-rust_serdev-v15-2-208ed2e6ec15@posteo.de>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Incorrect device tree property used for serial baud rate configuration.
--

--- Patch [2]: [PATCH v15 2/3] samples: rust: add Rust serial device bus sample device driver ---
commit 7885024c6abc3e1d37bf3499dc357753c532b4d5
Author: Markus Probst <markus.probst@posteo.de>

samples: rust: add Rust serial device bus sample device driver

This commit adds a sample Rust serial device bus device driver illustrating
the usage of the serial device bus abstractions. The driver probes through
either a match of device or driver name, or a match within the OF ID table.

> diff --git a/samples/rust/rust_driver_serdev.rs b/samples/rust/rust_driver_serdev.rs
> new file mode 100644
> index 0000000000000..a12b1412db30c
> --- /dev/null
> +++ b/samples/rust/rust_driver_serdev.rs
> @@ -0,0 +1,90 @@

[ ... ]

> +    fn probe<'bound>(
> +        sdev: &'bound serdev::Device<Core<'_>>,
> +        _info: Option<&'bound Self::IdInfo>,
> +    ) -> impl PinInit<Self, Error> + 'bound {
> +        let dev = sdev.as_ref();
> +
> +        dev_dbg!(dev, "Probe Rust Serial device bus device driver sample.\n");
> +
> +        if sdev
> +            .set_baudrate(
> +                dev.fwnode()
> +                    .and_then(|fwnode| fwnode.property_read(c"baudrate").optional())

[Severity: Medium]
Does this use the correct device tree property for the serial baud rate?

Standard serial device nodes typically use current-speed rather than
baudrate. If baudrate is queried, will the driver fail to read the
configured rate from standard nodes and silently fall back to the 115200
default? 

Since this is a sample driver, would it be better to query current-speed so
it serves as a correct template for new developers?

> +                    .unwrap_or(115200),
> +            )
> +            .is_err()
> +        {
> +            return Err(EINVAL);
> +        }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260718-rust_serdev-v15-0-208ed2e6ec15@posteo.de?part=2

  reply	other threads:[~2026-07-18 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-18 14:28 [PATCH v15 0/3] rust: add basic serial device bus abstractions Markus Probst
2026-07-18 14:28 ` [PATCH v15 1/3] " Markus Probst
2026-07-18 14:42   ` sashiko-bot
2026-07-18 14:28 ` [PATCH v15 2/3] samples: rust: add Rust serial device bus sample device driver Markus Probst
2026-07-18 14:40   ` sashiko-bot [this message]
2026-07-18 14:28 ` [PATCH v15 3/3] MAINTAINERS: serdev: Add self for serdev Markus Probst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260718144027.BCFF41F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=markus.probst@posteo.de \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.