All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [bug report] memory: aemif: add support for board files
Date: Thu, 06 Sep 2018 12:13:31 +0000	[thread overview]
Message-ID: <CAMpxmJV+A-9UVcrDBbCc6ej7FbdD8BW=eqJmLXsdWWHp-8mPqw@mail.gmail.com> (raw)
In-Reply-To: <20180906114112.4t3xe4kntptm55rh@kili.mountain>

2018-09-06 13:41 GMT+02:00 Dan Carpenter <dan.carpenter@oracle.com>:
> Hello Bartosz Golaszewski,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 8af70cd2ca50: "memory: aemif: add support for board files"
> from Apr 20, 2018, leads to the following Smatch complaint:
>
>     drivers/memory/ti-aemif.c:415 aemif_probe()
>      error: we previously assumed 'pdata' could be null (see line 387)
>
> drivers/memory/ti-aemif.c
>    363          if (np && of_device_is_compatible(np, "ti,da850-aemif"))
>    364                  aemif->cs_offset = 2;
>    365          else if (pdata)
>                          ^^^^^
> It's possible that when "np" is NULL that means pdata is non-NULL?
>
>    366                  aemif->cs_offset = pdata->cs_offset;
>    367
>    368          res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>    369          aemif->base = devm_ioremap_resource(dev, res);
>    370          if (IS_ERR(aemif->base)) {
>    371                  ret = PTR_ERR(aemif->base);
>    372                  goto error;
>    373          }
>    374
>    375          if (np) {
>    376                  /*
>    377                   * For every controller device node, there is a cs device node
>    378                   * that describe the bus configuration parameters. This
>    379                   * functions iterate over these nodes and update the cs data
>    380                   * array.
>    381                   */
>    382                  for_each_available_child_of_node(np, child_np) {
>    383                          ret = of_aemif_parse_abus_config(pdev, child_np);
>    384                          if (ret < 0)
>    385                                  goto error;
>    386                  }
>    387          } else if (pdata && pdata->num_abus_data > 0) {
>    388                  for (i = 0; i < pdata->num_abus_data; i++, aemif->num_cs++) {
>    389                          aemif->cs_data[i].cs = pdata->abus_data[i].cs;
>    390                          aemif_get_hw_params(pdev, i);
>    391                  }
>    392          }
>    393
>    394          for (i = 0; i < aemif->num_cs; i++) {
>    395                  ret = aemif_config_abus(pdev, i);
>    396                  if (ret < 0) {
>    397                          dev_err(dev, "Error configuring chip select %d\n",
>    398                                  aemif->cs_data[i].cs);
>    399                          goto error;
>    400                  }
>    401          }
>    402
>    403          /*
>    404           * Create a child devices explicitly from here to guarantee that the
>    405           * child will be probed after the AEMIF timing parameters are set.
>    406           */
>    407          if (np) {
>    408                  for_each_available_child_of_node(np, child_np) {
>    409                          ret = of_platform_populate(child_np, NULL,
>    410                                                     dev_lookup, dev);
>    411                          if (ret < 0)
>    412                                  goto error;
>    413                  }
>    414          } else {
>    415                  for (i = 0; i < pdata->num_sub_devices; i++) {
>                                         ^^^^^^^^^^^^^^^^^^^^^^
> Not checked.
>
>    416                          pdata->sub_devices[i].dev.parent = dev;
>    417                          ret = platform_device_register(&pdata->sub_devices[i]);
>
> regards,
> dan carpenter

Fix sent to mailing list. Thanks!

Bart

      reply	other threads:[~2018-09-06 12:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 11:41 [bug report] memory: aemif: add support for board files Dan Carpenter
2018-09-06 12:13 ` Bartosz Golaszewski [this message]

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='CAMpxmJV+A-9UVcrDBbCc6ej7FbdD8BW=eqJmLXsdWWHp-8mPqw@mail.gmail.com' \
    --to=bgolaszewski@baylibre.com \
    --cc=kernel-janitors@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.