linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Ludovic Desroches" <ludovic.desroches@microchip.com>
Cc: kbuild-all@lists.01.org, linux-clk@vger.kernel.org,
	kernel@pengutronix.de, linux-rtc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] rtc: at91sma9: Simplify using devm_clk_get_enabled()
Date: Thu, 25 Mar 2021 09:11:49 +0800	[thread overview]
Message-ID: <202103250947.SYK1K3ml-lkp@intel.com> (raw)
In-Reply-To: <20210324202711.76734-1-u.kleine-koenig@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 5497 bytes --]

Hi "Uwe,

I love your patch! Perhaps something to improve:

[auto build test WARNING on abelloni/rtc-next]
[also build test WARNING on v5.12-rc4 next-20210324]
[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/Uwe-Kleine-K-nig/rtc-at91sma9-Simplify-using-devm_clk_get_enabled/20210325-042956
base:   https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-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/782e62ed210e25e760c5607b2ac2dbf16f56ea0f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Uwe-Kleine-K-nig/rtc-at91sma9-Simplify-using-devm_clk_get_enabled/20210325-042956
        git checkout 782e62ed210e25e760c5607b2ac2dbf16f56ea0f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

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

All warnings (new ones prefixed by >>):

   drivers/rtc/rtc-at91sam9.c: In function 'at91_rtc_probe':
   drivers/rtc/rtc-at91sam9.c:377:14: error: implicit declaration of function 'devm_clk_get_enabled'; did you mean 'memcg_kmem_enabled'? [-Werror=implicit-function-declaration]
     377 |  rtc->sclk = devm_clk_get_enabled(&pdev->dev, NULL);
         |              ^~~~~~~~~~~~~~~~~~~~
         |              memcg_kmem_enabled
>> drivers/rtc/rtc-at91sam9.c:377:12: warning: assignment to 'struct clk *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     377 |  rtc->sclk = devm_clk_get_enabled(&pdev->dev, NULL);
         |            ^
   cc1: some warnings being treated as errors


vim +377 drivers/rtc/rtc-at91sam9.c

   331	
   332	/*
   333	 * Initialize and install RTC driver
   334	 */
   335	static int at91_rtc_probe(struct platform_device *pdev)
   336	{
   337		struct sam9_rtc	*rtc;
   338		int		ret, irq;
   339		u32		mr;
   340		unsigned int	sclk_rate;
   341		struct of_phandle_args args;
   342	
   343		irq = platform_get_irq(pdev, 0);
   344		if (irq < 0)
   345			return irq;
   346	
   347		rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
   348		if (!rtc)
   349			return -ENOMEM;
   350	
   351		spin_lock_init(&rtc->lock);
   352		rtc->irq = irq;
   353	
   354		/* platform setup code should have handled this; sigh */
   355		if (!device_can_wakeup(&pdev->dev))
   356			device_init_wakeup(&pdev->dev, 1);
   357	
   358		platform_set_drvdata(pdev, rtc);
   359	
   360		rtc->rtt = devm_platform_ioremap_resource(pdev, 0);
   361		if (IS_ERR(rtc->rtt))
   362			return PTR_ERR(rtc->rtt);
   363	
   364		ret = of_parse_phandle_with_fixed_args(pdev->dev.of_node,
   365						       "atmel,rtt-rtc-time-reg", 1, 0,
   366						       &args);
   367		if (ret)
   368			return ret;
   369	
   370		rtc->gpbr = syscon_node_to_regmap(args.np);
   371		rtc->gpbr_offset = args.args[0];
   372		if (IS_ERR(rtc->gpbr)) {
   373			dev_err(&pdev->dev, "failed to retrieve gpbr regmap, aborting.\n");
   374			return -ENOMEM;
   375		}
   376	
 > 377		rtc->sclk = devm_clk_get_enabled(&pdev->dev, NULL);
   378		if (IS_ERR(rtc->sclk))
   379			return PTR_ERR(rtc->sclk);
   380	
   381		sclk_rate = clk_get_rate(rtc->sclk);
   382		if (!sclk_rate || sclk_rate > AT91_RTT_RTPRES) {
   383			dev_err(&pdev->dev, "Invalid slow clock rate\n");
   384			return -EINVAL;
   385		}
   386	
   387		mr = rtt_readl(rtc, MR);
   388	
   389		/* unless RTT is counting at 1 Hz, re-initialize it */
   390		if ((mr & AT91_RTT_RTPRES) != sclk_rate) {
   391			mr = AT91_RTT_RTTRST | (sclk_rate & AT91_RTT_RTPRES);
   392			gpbr_writel(rtc, 0);
   393		}
   394	
   395		/* disable all interrupts (same as on shutdown path) */
   396		mr &= ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN);
   397		rtt_writel(rtc, MR, mr);
   398	
   399		rtc->rtcdev = devm_rtc_allocate_device(&pdev->dev);
   400		if (IS_ERR(rtc->rtcdev)) {
   401			ret = PTR_ERR(rtc->rtcdev);
   402			return ret;
   403		}
   404	
   405		rtc->rtcdev->ops = &at91_rtc_ops;
   406		rtc->rtcdev->range_max = U32_MAX;
   407	
   408		/* register irq handler after we know what name we'll use */
   409		ret = devm_request_irq(&pdev->dev, rtc->irq, at91_rtc_interrupt,
   410				       IRQF_SHARED | IRQF_COND_SUSPEND,
   411				       dev_name(&rtc->rtcdev->dev), rtc);
   412		if (ret) {
   413			dev_dbg(&pdev->dev, "can't share IRQ %d?\n", rtc->irq);
   414			return ret;
   415		}
   416	
   417		/* NOTE:  sam9260 rev A silicon has a ROM bug which resets the
   418		 * RTT on at least some reboots.  If you have that chip, you must
   419		 * initialize the time from some external source like a GPS, wall
   420		 * clock, discrete RTC, etc
   421		 */
   422	
   423		if (gpbr_readl(rtc) == 0)
   424			dev_warn(&pdev->dev, "%s: SET TIME!\n",
   425				 dev_name(&rtc->rtcdev->dev));
   426	
   427		return devm_rtc_register_device(rtc->rtcdev);
   428	}
   429	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 67452 bytes --]

  reply	other threads:[~2021-03-25  1:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210301135053.1462168-1-u.kleine-koenig@pengutronix.de>
2021-03-24 20:27 ` [PATCH] rtc: at91sma9: Simplify using devm_clk_get_enabled() Uwe Kleine-König
2021-03-25  1:11   ` kernel test robot [this message]
2021-03-25 15:15   ` kernel test robot

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=202103250947.SYK1K3ml-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=mturquette@baylibre.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=sboyd@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).