All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	Linux Samsung SOC <linux-samsung-soc@vger.kernel.org>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 7/7] tty: serial: samsung: simplify getting OF match data
Date: Tue, 8 Mar 2022 08:19:19 +0100	[thread overview]
Message-ID: <58418443-af3a-c799-624d-76fa1decc4a5@canonical.com> (raw)
In-Reply-To: <CAHp75VdN3MDDEjEoLAudtRW5pgHvfgP7Zt9Hv8OOhfZbHN9hpA@mail.gmail.com>

On 07/03/2022 21:24, Andy Shevchenko wrote:
> On Mon, Mar 7, 2022 at 11:20 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@canonical.com> wrote:
>>
>> Simplify the code with of_device_get_match_data().
> 
> You may get rid of ugly ifdeffery as well.
> 
> ...
> 
>>  static inline const struct s3c24xx_serial_drv_data *
>>  s3c24xx_get_driver_data(struct platform_device *pdev)
>>  {
>>  #ifdef CONFIG_OF
>> -       if (pdev->dev.of_node) {
>> -               const struct of_device_id *match;
>> -
>> -               match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node);
>> -               return (struct s3c24xx_serial_drv_data *)match->data;
>> -       }
> 
>> +       if (pdev->dev.of_node)
> 
> I believe it's never true when CONFIG_OF=n,

Right, I can use dev_of_node() helper for that purpose as well. Thanks!


Best regards,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	Linux Samsung SOC <linux-samsung-soc@vger.kernel.org>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 7/7] tty: serial: samsung: simplify getting OF match data
Date: Tue, 8 Mar 2022 08:19:19 +0100	[thread overview]
Message-ID: <58418443-af3a-c799-624d-76fa1decc4a5@canonical.com> (raw)
In-Reply-To: <CAHp75VdN3MDDEjEoLAudtRW5pgHvfgP7Zt9Hv8OOhfZbHN9hpA@mail.gmail.com>

On 07/03/2022 21:24, Andy Shevchenko wrote:
> On Mon, Mar 7, 2022 at 11:20 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@canonical.com> wrote:
>>
>> Simplify the code with of_device_get_match_data().
> 
> You may get rid of ugly ifdeffery as well.
> 
> ...
> 
>>  static inline const struct s3c24xx_serial_drv_data *
>>  s3c24xx_get_driver_data(struct platform_device *pdev)
>>  {
>>  #ifdef CONFIG_OF
>> -       if (pdev->dev.of_node) {
>> -               const struct of_device_id *match;
>> -
>> -               match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node);
>> -               return (struct s3c24xx_serial_drv_data *)match->data;
>> -       }
> 
>> +       if (pdev->dev.of_node)
> 
> I believe it's never true when CONFIG_OF=n,

Right, I can use dev_of_node() helper for that purpose as well. Thanks!


Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-03-08  7:19 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220307080826epcas5p13d71054f6b461cff91edbbb2cf42491a@epcas5p1.samsung.com>
2022-03-07  8:08 ` [PATCH v2 0/7] tty: serial: samsung: minor fixes/cleanups Krzysztof Kozlowski
2022-03-07  8:08   ` Krzysztof Kozlowski
2022-03-07  8:08   ` [PATCH v2 1/7] tty: serial: samsung: embed s3c24xx_uart_info in parent structure Krzysztof Kozlowski
2022-03-07  8:08     ` Krzysztof Kozlowski
2022-03-07  8:08   ` Krzysztof Kozlowski
2022-03-07  8:08     ` Krzysztof Kozlowski
2022-03-07  8:10     ` Krzysztof Kozlowski
2022-03-07  8:10       ` Krzysztof Kozlowski
2022-03-07  8:09   ` [PATCH v2 2/7] tty: serial: samsung: embed s3c2410_uartcfg " Krzysztof Kozlowski
2022-03-07  8:09     ` Krzysztof Kozlowski
2022-03-07  8:09   ` [PATCH v2 3/7] tty: serial: samsung: constify s3c24xx_serial_drv_data Krzysztof Kozlowski
2022-03-07  8:09     ` Krzysztof Kozlowski
2022-03-07  8:33     ` Jiri Slaby
2022-03-07  8:33       ` Jiri Slaby
2022-03-07  8:40       ` Krzysztof Kozlowski
2022-03-07  8:40         ` Krzysztof Kozlowski
2022-03-08  8:06         ` Krzysztof Kozlowski
2022-03-08  8:06           ` Krzysztof Kozlowski
2022-03-07 18:18     ` Alim Akhtar
2022-03-07 18:18       ` Alim Akhtar
2022-03-07  8:09   ` [PATCH v2 4/7] tty: serial: samsung: constify UART name Krzysztof Kozlowski
2022-03-07  8:09     ` Krzysztof Kozlowski
2022-03-07  8:09   ` [PATCH v2 5/7] tty: serial: samsung: constify s3c24xx_serial_drv_data members Krzysztof Kozlowski
2022-03-07  8:09     ` Krzysztof Kozlowski
2022-03-07  8:09   ` [PATCH v2 6/7] tty: serial: samsung: constify variables and pointers Krzysztof Kozlowski
2022-03-07  8:09     ` Krzysztof Kozlowski
2022-03-07  8:09   ` [PATCH v2 7/7] tty: serial: samsung: simplify getting OF match data Krzysztof Kozlowski
2022-03-07  8:09     ` Krzysztof Kozlowski
2022-03-07 18:16     ` Alim Akhtar
2022-03-07 18:16       ` Alim Akhtar
2022-03-07 20:24     ` Andy Shevchenko
2022-03-07 20:24       ` Andy Shevchenko
2022-03-08  7:19       ` Krzysztof Kozlowski [this message]
2022-03-08  7:19         ` Krzysztof Kozlowski
2022-03-07 18:21   ` [PATCH v2 0/7] tty: serial: samsung: minor fixes/cleanups Alim Akhtar
2022-03-07 18:21     ` Alim Akhtar

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=58418443-af3a-c799-624d-76fa1decc4a5@canonical.com \
    --to=krzysztof.kozlowski@canonical.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-serial@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.