Skip to content

Commit

Permalink
fpga: machxo2-spi: Address warning about unused variable
Browse files Browse the repository at this point in the history
Address warning about unused variable in case CONFIG_OF is not set.

warning: unused variable 'of_match' [-Wunused-const-variable]
    static const struct of_device_id of_match[] = {

Fixes: 88fb3a0 ("fpga: lattice machxo2: Add Lattice MachXO2 support")
Cc: Arnd Bergmann <[email protected]>
Cc: Tom Rix <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Reported-by: Arnd Bergmann <[email protected]>
Signed-off-by: Moritz Fischer <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
mfischer authored and gregkh committed Jun 24, 2021
1 parent 37a0ca7 commit 1e2658a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/fpga/machxo2-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,13 @@ static int machxo2_spi_probe(struct spi_device *spi)
return devm_fpga_mgr_register(dev, mgr);
}

#ifdef CONFIG_OF
static const struct of_device_id of_match[] = {
{ .compatible = "lattice,machxo2-slave-spi", },
{}
};
MODULE_DEVICE_TABLE(of, of_match);
#endif

static const struct spi_device_id lattice_ids[] = {
{ "machxo2-slave-spi", 0 },
Expand Down

0 comments on commit 1e2658a

Please sign in to comment.