From 237087f61a75b87ead957762bc111abf7996d203 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:38:38 +0900 Subject: [PATCH] arch: cxd56xx: Fix issue by update of inode reference Fix an issue of driver open failure caused by the following commit that changes the initial value of inode reference. 43d0d95f81 fs/inode: using inode reference to indicate unlink and simply code --- arch/arm/src/cxd56xx/cxd56_sph.c | 2 +- arch/arm/src/cxd56xx/cxd56_uart0.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/cxd56xx/cxd56_sph.c b/arch/arm/src/cxd56xx/cxd56_sph.c index 6f40e2cd6b..f770d7753f 100644 --- a/arch/arm/src/cxd56xx/cxd56_sph.c +++ b/arch/arm/src/cxd56xx/cxd56_sph.c @@ -104,7 +104,7 @@ static int sph_open(struct file *filep) { /* Exclusive access */ - if (filep->f_inode->i_crefs > 1) + if (filep->f_inode->i_crefs > 2) { return ERROR; } diff --git a/arch/arm/src/cxd56xx/cxd56_uart0.c b/arch/arm/src/cxd56xx/cxd56_uart0.c index e7c13b7679..1f1841f200 100644 --- a/arch/arm/src/cxd56xx/cxd56_uart0.c +++ b/arch/arm/src/cxd56xx/cxd56_uart0.c @@ -115,7 +115,7 @@ static int uart0_open(struct file *filep) int stop; int ret; - if (inode->i_crefs > 1) + if (inode->i_crefs > 2) { return OK; } @@ -172,7 +172,7 @@ static int uart0_close(struct file *filep) { struct inode *inode = filep->f_inode; - if (inode->i_crefs == 1) + if (inode->i_crefs == 2) { fw_pd_uartdisable(0); fw_pd_uartuninit(0);