diff options
Diffstat (limited to 'drivers/spi/ath79_spi.c')
-rw-r--r-- | drivers/spi/ath79_spi.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c index bb63d864ae..41a31ae922 100644 --- a/drivers/spi/ath79_spi.c +++ b/drivers/spi/ath79_spi.c @@ -1,19 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2013, 2014 Antony Pavlov <antonynpavlov@gmail.com> * * This file is part of barebox. - * See file CREDITS for list of people who contributed to this project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #include <common.h> @@ -56,7 +45,7 @@ static inline void ath79_spi_wr(struct ath79_spi *sp, u32 val, int reg) __raw_writel(val, sp->regs + reg); } -static inline void setbits(struct ath79_spi *sp, int bits, int on) +static inline void ath79_spi_setbits(struct ath79_spi *sp, int bits, int on) { /* * We are the only user of SCSPTR so no locking is required. @@ -83,14 +72,14 @@ static inline void setsck(struct spi_device *spi, int on) { struct ath79_spi *sc = ath79_spidev_to_sp(spi); - setbits(sc, AR71XX_SPI_IOC_CLK, on); + ath79_spi_setbits(sc, AR71XX_SPI_IOC_CLK, on); } static inline void setmosi(struct spi_device *spi, int on) { struct ath79_spi *sc = ath79_spidev_to_sp(spi); - setbits(sc, AR71XX_SPI_IOC_DO, on); + ath79_spi_setbits(sc, AR71XX_SPI_IOC_DO, on); } static inline u32 getmiso(struct spi_device *spi) @@ -137,7 +126,7 @@ static inline void ath79_spi_chipselect(struct ath79_spi *sp, int chipselect) static int ath79_spi_setup(struct spi_device *spi) { struct spi_master *master = spi->master; - struct device_d spi_dev = spi->dev; + struct device spi_dev = spi->dev; if (spi->bits_per_word != 8) { dev_err(master->dev, "master doesn't support %d bits per word requested by %s\n", @@ -231,7 +220,7 @@ static void ath79_spi_disable(struct ath79_spi *sp) ath79_spi_wr(sp, 0, AR71XX_SPI_REG_FS); } -static int ath79_spi_probe(struct device_d *dev) +static int ath79_spi_probe(struct device *dev) { struct resource *iores; struct spi_master *master; @@ -249,7 +238,7 @@ static int ath79_spi_probe(struct device_d *dev) master->num_chipselect = 3; if (IS_ENABLED(CONFIG_OFDEVICE)) { - struct device_node *node = dev->device_node; + struct device_node *node = dev->of_node; u32 num_cs; int ret; @@ -280,7 +269,7 @@ static int ath79_spi_probe(struct device_d *dev) return 0; } -static void ath79_spi_remove(struct device_d *dev) +static void ath79_spi_remove(struct device *dev) { struct ath79_spi *sp = dev->priv; @@ -295,8 +284,9 @@ static __maybe_unused struct of_device_id ath79_spi_dt_ids[] = { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, ath79_spi_dt_ids); -static struct driver_d ath79_spi_driver = { +static struct driver ath79_spi_driver = { .name = "ath79-spi", .probe = ath79_spi_probe, .remove = ath79_spi_remove, |