diff mbox series

[01/14] rtc: ac100: use rtc_lock/rtc_unlock

Message ID 20210119220653.677750-1-alexandre.belloni@bootlin.com
State Superseded
Headers show
Series [01/14] rtc: ac100: use rtc_lock/rtc_unlock | expand

Commit Message

Alexandre Belloni Jan. 19, 2021, 10:06 p.m. UTC
Avoid accessing directly rtc->ops_lock and use the RTC core helpers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-ac100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

kernel test robot Jan. 20, 2021, 5:50 p.m. UTC | #1
Hi Alexandre,

I love your patch! Yet something to improve:

[auto build test ERROR on abelloni/rtc-next]
[also build test ERROR on stm32/stm32-next linux/master linus/master v5.11-rc4 next-20210120]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alexandre-Belloni/rtc-ac100-use-rtc_lock-rtc_unlock/20210120-172843
base:   https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
config: arm-sunxi_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/b6052366a7328ef9db6ad0d0fc7ea94e542a6f05
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alexandre-Belloni/rtc-ac100-use-rtc_lock-rtc_unlock/20210120-172843
        git checkout b6052366a7328ef9db6ad0d0fc7ea94e542a6f05
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from drivers/rtc/rtc-ac100.c:21:
   drivers/rtc/rtc-ac100.c: In function 'ac100_rtc_irq':
>> include/linux/rtc.h:165:32: error: lvalue required as unary '&' operand
     165 | #define rtc_lock(d) mutex_lock(&d->ops_lock)
         |                                ^
   drivers/rtc/rtc-ac100.c:531:2: note: in expansion of macro 'rtc_lock'
     531 |  rtc_lock(&chip->rtc);
         |  ^~~~~~~~
   include/linux/rtc.h:166:36: error: lvalue required as unary '&' operand
     166 | #define rtc_unlock(d) mutex_unlock(&d->ops_lock)
         |                                    ^
   drivers/rtc/rtc-ac100.c:554:2: note: in expansion of macro 'rtc_unlock'
     554 |  rtc_unlock(&chip->rtc);
         |  ^~~~~~~~~~


vim +165 include/linux/rtc.h

0c86edc0d4970649 Alessandro Zummo  2006-03-27  164  
ae48668843382593 Alexandre Belloni 2019-10-19 @165  #define rtc_lock(d) mutex_lock(&d->ops_lock)
ae48668843382593 Alexandre Belloni 2019-10-19  166  #define rtc_unlock(d) mutex_unlock(&d->ops_lock)
ae48668843382593 Alexandre Belloni 2019-10-19  167  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-ac100.c b/drivers/rtc/rtc-ac100.c
index 1ddbef99e38f..92f690542ad2 100644
--- a/drivers/rtc/rtc-ac100.c
+++ b/drivers/rtc/rtc-ac100.c
@@ -528,7 +528,7 @@  static irqreturn_t ac100_rtc_irq(int irq, void *data)
 	unsigned int val = 0;
 	int ret;
 
-	mutex_lock(&chip->rtc->ops_lock);
+	rtc_lock(&chip->rtc);
 
 	/* read status */
 	ret = regmap_read(regmap, AC100_ALM_INT_STA, &val);
@@ -551,7 +551,7 @@  static irqreturn_t ac100_rtc_irq(int irq, void *data)
 	}
 
 out:
-	mutex_unlock(&chip->rtc->ops_lock);
+	rtc_unlock(&chip->rtc);
 	return IRQ_HANDLED;
 }