From: Bartosz Golaszewski Date: Mon, 8 Jul 2024 09:48:58 +0000 (+0200) Subject: bindings: rust: tests: set direction when reconfiguring lines X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2515fae57d88e0f4e916e66e358912b9f98914dd;p=qemu-gpiodev%2Flibgpiod.git bindings: rust: tests: set direction when reconfiguring lines Linux kernel commit b44039638741 ("gpiolib: cdev: Ignore reconfiguration without direction") made the direction setting mandatory for line config passed to the kernel when reconfiguring requested lines. Fix the Rust test cases which don't do it and now fail due to the rest of the settings being ignored. Reviewed-by: Kent Gibson Link: https://lore.kernel.org/r/20240708094858.85015-1-brgl@bgdev.pl Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/rust/libgpiod/tests/line_request.rs b/bindings/rust/libgpiod/tests/line_request.rs index 4e095a4..4ba0d18 100644 --- a/bindings/rust/libgpiod/tests/line_request.rs +++ b/bindings/rust/libgpiod/tests/line_request.rs @@ -138,6 +138,7 @@ mod line_request { // Value read properly after reconfigure let mut lsettings = line::Settings::new().unwrap(); lsettings.set_active_low(true); + lsettings.set_direction(Direction::Input).unwrap(); let mut lconfig = line::Config::new().unwrap(); lconfig.add_line_settings(&offsets, lsettings).unwrap(); request.reconfigure_lines(&lconfig).unwrap(); @@ -452,6 +453,7 @@ mod line_request { let mut lconfig = line::Config::new().unwrap(); let mut lsettings = line::Settings::new().unwrap(); lsettings.set_event_clock(EventClock::Monotonic).unwrap(); + lsettings.set_direction(Direction::Input).unwrap(); lconfig.add_line_settings(&[0], lsettings).unwrap(); config.request().reconfigure_lines(&lconfig).unwrap(); let info = config.chip().line_info(0).unwrap(); @@ -460,6 +462,7 @@ mod line_request { let mut lconfig = line::Config::new().unwrap(); let mut lsettings = line::Settings::new().unwrap(); lsettings.set_event_clock(EventClock::Realtime).unwrap(); + lsettings.set_direction(Direction::Input).unwrap(); lconfig.add_line_settings(&[0], lsettings).unwrap(); config.request().reconfigure_lines(&lconfig).unwrap(); let info = config.chip().line_info(0).unwrap();