lkml.org 
[lkml]   [2023]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 01/15] spi: Remove unneeded OF node NULL checks
From
Il 10/07/23 17:49, Andy Shevchenko ha scritto:
> In the couple of places the NULL check of OF node is implied by the call
> that takes it as a parameter. Drop the respective duplicate checks.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Validated against spi-mt65xx, spi-mt7621, spi-mtk-nor, spi-mtk-snfi;

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> #
MediaTek

> ---
> drivers/spi/spi.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 9291b2a0e887..8f3282a71c63 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -2399,9 +2399,6 @@ static void of_register_spi_devices(struct spi_controller *ctlr)
> struct spi_device *spi;
> struct device_node *nc;
>
> - if (!ctlr->dev.of_node)
> - return;
> -
> for_each_available_child_of_node(ctlr->dev.of_node, nc) {
> if (of_node_test_and_set_flag(nc, OF_POPULATED))
> continue;
> @@ -3134,7 +3131,7 @@ int spi_register_controller(struct spi_controller *ctlr)
> if (WARN(id < 0, "couldn't get idr"))
> return id == -ENOSPC ? -EBUSY : id;
> ctlr->bus_num = id;
> - } else if (ctlr->dev.of_node) {
> + } else {
> /* Allocate dynamic bus number using Linux idr */
> id = of_alias_get_id(ctlr->dev.of_node, "spi");
> if (id >= 0) {



\
 
 \ /
  Last update: 2023-07-11 10:14    [W:0.163 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site