diff mbox series

[v1,2/2] selftests: gpio: gpio-sim: Use same variable name for sysfs pathname

Message ID 20230411171521.29678-2-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit 61c65a8b50c22ef17839df6f342df44a5631400a
Headers show
Series [v1,1/2] selftests: gpio: gpio-sim: Fix BUG: test FAILED due to recent change | expand

Commit Message

Andy Shevchenko April 11, 2023, 5:15 p.m. UTC
SYSFS_PATH can be used locally and globally, especially that has
the same content.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 tools/testing/selftests/gpio/gpio-sim.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andy Shevchenko April 11, 2023, 5:48 p.m. UTC | #1
On Tue, Apr 11, 2023 at 08:15:21PM +0300, Andy Shevchenko wrote:
> SYSFS_PATH can be used locally and globally, especially that has
> the same content.

This may behave differently from shell to shell, the minimum of bash, zsh,
and ash would be good to test.
Bartosz Golaszewski June 16, 2023, 9:10 a.m. UTC | #2
On Tue, Apr 11, 2023 at 7:15 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> SYSFS_PATH can be used locally and globally, especially that has
> the same content.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  tools/testing/selftests/gpio/gpio-sim.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/gpio/gpio-sim.sh b/tools/testing/selftests/gpio/gpio-sim.sh
> index fa2ce2b9dd5f..6fb66a687f17 100755
> --- a/tools/testing/selftests/gpio/gpio-sim.sh
> +++ b/tools/testing/selftests/gpio/gpio-sim.sh
> @@ -152,9 +152,9 @@ sysfs_set_pull() {
>         local PULL=$4
>         local DEVNAME=`configfs_dev_name $DEV`
>         local CHIPNAME=`configfs_chip_name $DEV $BANK`
> -       local SYSFSPATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio$OFFSET/pull"
> +       local SYSFS_PATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio$OFFSET/pull"
>
> -       echo $PULL > $SYSFSPATH || fail "Unable to set line pull in sysfs"
> +       echo $PULL > $SYSFS_PATH || fail "Unable to set line pull in sysfs"
>  }
>
>  # Load the gpio-sim module. This will pull in configfs if needed too.
> --
> 2.40.0.1.gaa8946217a0b
>

Applied, thanks!

Bart
diff mbox series

Patch

diff --git a/tools/testing/selftests/gpio/gpio-sim.sh b/tools/testing/selftests/gpio/gpio-sim.sh
index fa2ce2b9dd5f..6fb66a687f17 100755
--- a/tools/testing/selftests/gpio/gpio-sim.sh
+++ b/tools/testing/selftests/gpio/gpio-sim.sh
@@ -152,9 +152,9 @@  sysfs_set_pull() {
 	local PULL=$4
 	local DEVNAME=`configfs_dev_name $DEV`
 	local CHIPNAME=`configfs_chip_name $DEV $BANK`
-	local SYSFSPATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio$OFFSET/pull"
+	local SYSFS_PATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio$OFFSET/pull"
 
-	echo $PULL > $SYSFSPATH || fail "Unable to set line pull in sysfs"
+	echo $PULL > $SYSFS_PATH || fail "Unable to set line pull in sysfs"
 }
 
 # Load the gpio-sim module. This will pull in configfs if needed too.