Skip to content

Commit

Permalink
spi: remove duplicate parameters check in acpi_spi_add_resource()
Browse files Browse the repository at this point in the history
The acpi_spi_add_resource() is never called with ctrl == NULL and
index == -1. The only caller already performs the check. Hence
remove the duplication from the acpi_spi_add_resource().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220709000709.35622-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Andy Shevchenko authored and Mark Brown committed Jul 11, 2022
1 parent b6747f4 commit cdb0cc9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2453,9 +2453,6 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
if (lookup->index != -1 && lookup->n++ != lookup->index)
return 1;

if (lookup->index == -1 && !ctlr)
return -ENODEV;

status = acpi_get_handle(NULL,
sb->resource_source.string_ptr,
&parent_handle);
Expand Down

0 comments on commit cdb0cc9

Please sign in to comment.