public inbox for linux-rtc@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: robh@kernel.org
Cc: linux-rtc@vger.kernel.org
Subject: [bug report] rtc: pxa: convert to use shared sa1100 functions
Date: Wed, 18 Apr 2018 17:23:08 +0300	[thread overview]
Message-ID: <20180418142308.GA13543@mwanda> (raw)

[ This code is several years old now.  - dan ]

Hello Rob Herring,

The patch 3cdf4ad9633e: "rtc: pxa: convert to use shared sa1100
functions" from May 13, 2015, leads to the following static checker
warning:

	drivers/rtc/rtc-pxa.c:368 pxa_rtc_probe()
	info: return a literal instead of 'ret'

drivers/rtc/rtc-pxa.c
   352          pxa_rtc->base = devm_ioremap(dev, pxa_rtc->ress->start,
   353                                  resource_size(pxa_rtc->ress));
   354          if (!pxa_rtc->base) {
   355                  dev_err(dev, "Unable to map pxa RTC I/O memory\n");
   356                  return -ENOMEM;
   357          }
   358  
   359          pxa_rtc_open(dev);
   360  
   361          sa1100_rtc->rcnr = pxa_rtc->base + 0x0;
   362          sa1100_rtc->rtsr = pxa_rtc->base + 0x8;
   363          sa1100_rtc->rtar = pxa_rtc->base + 0x4;
   364          sa1100_rtc->rttr = pxa_rtc->base + 0xc;
   365          ret = sa1100_rtc_init(pdev, sa1100_rtc);
   366          if (!ret) {
                    ^^^^
This test really looks like it's inverted to me.

   367                  dev_err(dev, "Unable to init SA1100 RTC sub-device\n");
   368                  return ret;
   369          }
   370  
   371          rtsr_clear_bits(pxa_rtc, RTSR_PIALE | RTSR_RDALE1 | RTSR_HZE);
   372  
   373          pxa_rtc->rtc = devm_rtc_device_register(&pdev->dev, "pxa-rtc",
   374                                                  &pxa_rtc_ops, THIS_MODULE);
   375          if (IS_ERR(pxa_rtc->rtc)) {
   376                  ret = PTR_ERR(pxa_rtc->rtc);
   377                  dev_err(dev, "Failed to register RTC device -> %d\n", ret);
   378                  return ret;
   379          }
   380  
   381          device_init_wakeup(dev, 1);
   382  
   383          return 0;


regards,
dan carpenter

             reply	other threads:[~2018-04-18 14:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 14:23 Dan Carpenter [this message]
2018-04-18 15:58 ` [bug report] rtc: pxa: convert to use shared sa1100 functions Rob Herring
2018-04-18 16:12   ` Dan Carpenter

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=20180418142308.GA13543@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=robh@kernel.org \
    /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