mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: Avi Fishman <avifishman70@gmail.com>
Cc: Medad CChien <medadyoung@gmail.com>,
	rric@kernel.org, James Morse <james.morse@arm.com>,
	tony.luck@intel.com, Mauro Carvalho Chehab <mchehab@kernel.org>,
	Borislav Petkov <bp@alien8.de>, Rob Herring <robh+dt@kernel.org>,
	Benjamin Fair <benjaminfair@google.com>,
	Nancy Yuen <yuenn@google.com>,
	Patrick Venture <venture@google.com>,
	KWLIU@nuvoton.com, YSCHU@nuvoton.com, JJLIU0@nuvoton.com,
	KFTING@nuvoton.com, Tomer Maimon <tmaimon77@gmail.com>,
	Tali Perry <tali.perry1@gmail.com>,
	ctcchien@nuvoton.com, linux-edac <linux-edac@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH v3 3/3] EDAC: nuvoton: Add NPCM memory controller driver
Date: Mon, 14 Mar 2022 08:35:14 +0100	[thread overview]
Message-ID: <4f8fffa7-631a-9b87-ee0a-0fb7dc1fec66@canonical.com> (raw)
In-Reply-To: <CAKKbWA7Pr8Gi-rU5_BZ32y5aiLV0tSM19WkRe+zF8spWdk5zMg@mail.gmail.com>

On 13/03/2022 21:22, Avi Fishman wrote:
> On Fri, Mar 11, 2022 at 11:15 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@canonical.com> wrote:
>>
>> On 11/03/2022 02:42, Medad CChien wrote:
>>> Add support for Nuvoton NPCM SoC.
>>>
>>> Signed-off-by: Medad CChien <ctcchien@nuvoton.com>
>>> ---
>>>  drivers/edac/Kconfig     |   9 +
>>>  drivers/edac/Makefile    |   1 +
>>>  drivers/edac/npcm_edac.c | 714 +++++++++++++++++++++++++++++++++++++++
>>>  3 files changed, 724 insertions(+)
>>>  create mode 100644 drivers/edac/npcm_edac.c
>>>
>>> diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
>>> index 58ab63642e72..757e1d160640 100644
>>> --- a/drivers/edac/Kconfig
>>> +++ b/drivers/edac/Kconfig
>>> @@ -539,4 +539,13 @@ config EDAC_DMC520
>>>         Support for error detection and correction on the
>>>         SoCs with ARM DMC-520 DRAM controller.
>>>
>>> +config EDAC_NPCM
>>> +     tristate "Nuvoton NPCM DDR Memory Controller"
>>> +     depends on ARCH_NPCM
>>
>> || COMPILE_TEST
>> (and test if it compiles)
>>
>> (...)
>>
>>> +
>>> +MODULE_DEVICE_TABLE(of, npcm_edac_of_match);
>>> +
>>> +static int npcm_edac_mc_probe(struct platform_device *pdev)
>>> +{
>>> +     const struct npcm_edac_platform_data *npcm_chip;
>>> +     struct device *dev = &pdev->dev;
>>> +     struct edac_mc_layer layers[1];
>>> +     const struct of_device_id *id;
>>> +     struct priv_data *priv_data;
>>> +     struct mem_ctl_info *mci;
>>> +     struct resource *res;
>>> +     void __iomem *reg;
>>> +     int ret = -ENODEV;
>>> +     int irq;
>>> +
>>> +     id = of_match_device(npcm_edac_of_match, &pdev->dev);
>>> +     if (!id)
>>> +             return -ENODEV;
>>
>> Why do you need it? How such case is even possible?
>>
>>> +
>>> +     npcm_chip = of_device_get_match_data(&pdev->dev);
>>> +     if (!npcm_chip)
>>> +             return -ENODEV;
>>
>> I wonder, how is it possible to have here NULL?
>>
> Both of_match_device() and of_device_get_match_data() can return NULL,
> are we missing something?

I think your driver is OF-only, right? If yes, how is it possible to be
here in probe() (meaning: being matched by of_device_id) and a few lines
later do not match the same of_device_id?

Best regards,
Krzysztof

  reply	other threads:[~2022-03-14  7:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11  1:42 [PATCH v3 0/3] EDAC: nuvoton: Add nuvoton " Medad CChien
2022-03-11  1:42 ` [PATCH v3 1/3] ARM: dts: nuvoton: Add new device node Medad CChien
2022-03-11  8:58   ` Krzysztof Kozlowski
2022-03-14  5:22     ` Medad Young
2022-03-12  2:31   ` Jonathan Neuschäfer
2022-03-14  5:22     ` Medad Young
2022-03-11  1:42 ` [PATCH v3 2/3] dt-bindings: edac: nuvoton,npcm-memory-controller.yaml Medad CChien
2022-03-11  8:58   ` Krzysztof Kozlowski
2022-03-11 13:28   ` Rob Herring
2022-03-11  1:42 ` [PATCH v3 3/3] EDAC: nuvoton: Add NPCM memory controller driver Medad CChien
2022-03-11  9:15   ` Krzysztof Kozlowski
2022-03-13 20:22     ` Avi Fishman
2022-03-14  7:35       ` Krzysztof Kozlowski [this message]
2022-03-14  8:23         ` Medad Young
2022-03-14  5:32     ` Medad Young
2022-03-14  7:36       ` Krzysztof Kozlowski
2022-03-14  8:24         ` Medad Young
2022-03-11 23:25   ` 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=4f8fffa7-631a-9b87-ee0a-0fb7dc1fec66@canonical.com \
    --to=krzysztof.kozlowski@canonical.com \
    --cc=JJLIU0@nuvoton.com \
    --cc=KFTING@nuvoton.com \
    --cc=KWLIU@nuvoton.com \
    --cc=YSCHU@nuvoton.com \
    --cc=avifishman70@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=bp@alien8.de \
    --cc=ctcchien@nuvoton.com \
    --cc=devicetree@vger.kernel.org \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=medadyoung@gmail.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=robh+dt@kernel.org \
    --cc=rric@kernel.org \
    --cc=tali.perry1@gmail.com \
    --cc=tmaimon77@gmail.com \
    --cc=tony.luck@intel.com \
    --cc=venture@google.com \
    --cc=yuenn@google.com \
    /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

all inboxes | Powered by JetHome®