Skip to content

Commit cf9d0dc

Browse files
bhadramdavem330
authored andcommitted
ethernet: qualcomm: use spi instead of spi_device
All spi based drivers have an instance of struct spi_device as spi. This patch renames spi_device to spi to synchronize with all the drivers. Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3e3b346 commit cf9d0dc

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

‎drivers/net/ethernet/qualcomm/qca_spi.c‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -839,60 +839,60 @@ static const struct of_device_id qca_spi_of_match[] = {
839839
MODULE_DEVICE_TABLE(of, qca_spi_of_match);
840840

841841
static int
842-
qca_spi_probe(struct spi_device *spi_device)
842+
qca_spi_probe(struct spi_device *spi)
843843
{
844844
struct qcaspi *qca = NULL;
845845
struct net_device *qcaspi_devs = NULL;
846846
u8 legacy_mode = 0;
847847
u16 signature;
848848
const char *mac;
849849

850-
if (!spi_device->dev.of_node) {
851-
dev_err(&spi_device->dev, "Missing device tree\n");
850+
if (!spi->dev.of_node) {
851+
dev_err(&spi->dev, "Missing device tree\n");
852852
return -EINVAL;
853853
}
854854

855-
legacy_mode = of_property_read_bool(spi_device->dev.of_node,
855+
legacy_mode = of_property_read_bool(spi->dev.of_node,
856856
"qca,legacy-mode");
857857

858858
if (qcaspi_clkspeed == 0) {
859-
if (spi_device->max_speed_hz)
860-
qcaspi_clkspeed = spi_device->max_speed_hz;
859+
if (spi->max_speed_hz)
860+
qcaspi_clkspeed = spi->max_speed_hz;
861861
else
862862
qcaspi_clkspeed = QCASPI_CLK_SPEED;
863863
}
864864

865865
if ((qcaspi_clkspeed < QCASPI_CLK_SPEED_MIN) ||
866866
(qcaspi_clkspeed > QCASPI_CLK_SPEED_MAX)) {
867-
dev_info(&spi_device->dev, "Invalid clkspeed: %d\n",
867+
dev_info(&spi->dev, "Invalid clkspeed: %d\n",
868868
qcaspi_clkspeed);
869869
return -EINVAL;
870870
}
871871

872872
if ((qcaspi_burst_len < QCASPI_BURST_LEN_MIN) ||
873873
(qcaspi_burst_len > QCASPI_BURST_LEN_MAX)) {
874-
dev_info(&spi_device->dev, "Invalid burst len: %d\n",
874+
dev_info(&spi->dev, "Invalid burst len: %d\n",
875875
qcaspi_burst_len);
876876
return -EINVAL;
877877
}
878878

879879
if ((qcaspi_pluggable < QCASPI_PLUGGABLE_MIN) ||
880880
(qcaspi_pluggable > QCASPI_PLUGGABLE_MAX)) {
881-
dev_info(&spi_device->dev, "Invalid pluggable: %d\n",
881+
dev_info(&spi->dev, "Invalid pluggable: %d\n",
882882
qcaspi_pluggable);
883883
return -EINVAL;
884884
}
885885

886-
dev_info(&spi_device->dev, "ver=%s, clkspeed=%d, burst_len=%d, pluggable=%d\n",
886+
dev_info(&spi->dev, "ver=%s, clkspeed=%d, burst_len=%d, pluggable=%d\n",
887887
QCASPI_DRV_VERSION,
888888
qcaspi_clkspeed,
889889
qcaspi_burst_len,
890890
qcaspi_pluggable);
891891

892-
spi_device->mode = SPI_MODE_3;
893-
spi_device->max_speed_hz = qcaspi_clkspeed;
894-
if (spi_setup(spi_device) < 0) {
895-
dev_err(&spi_device->dev, "Unable to setup SPI device\n");
892+
spi->mode = SPI_MODE_3;
893+
spi->max_speed_hz = qcaspi_clkspeed;
894+
if (spi_setup(spi) < 0) {
895+
dev_err(&spi->dev, "Unable to setup SPI device\n");
896896
return -EFAULT;
897897
}
898898

@@ -905,21 +905,21 @@ qca_spi_probe(struct spi_device *spi_device)
905905
qca = netdev_priv(qcaspi_devs);
906906
if (!qca) {
907907
free_netdev(qcaspi_devs);
908-
dev_err(&spi_device->dev, "Fail to retrieve private structure\n");
908+
dev_err(&spi->dev, "Fail to retrieve private structure\n");
909909
return -ENOMEM;
910910
}
911911
qca->net_dev = qcaspi_devs;
912-
qca->spi_dev = spi_device;
912+
qca->spi_dev = spi;
913913
qca->legacy_mode = legacy_mode;
914914

915-
mac = of_get_mac_address(spi_device->dev.of_node);
915+
mac = of_get_mac_address(spi->dev.of_node);
916916

917917
if (mac)
918918
ether_addr_copy(qca->net_dev->dev_addr, mac);
919919

920920
if (!is_valid_ether_addr(qca->net_dev->dev_addr)) {
921921
eth_hw_addr_random(qca->net_dev);
922-
dev_info(&spi_device->dev, "Using random MAC address: %pM\n",
922+
dev_info(&spi->dev, "Using random MAC address: %pM\n",
923923
qca->net_dev->dev_addr);
924924
}
925925

@@ -930,31 +930,31 @@ qca_spi_probe(struct spi_device *spi_device)
930930
qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature);
931931

932932
if (signature != QCASPI_GOOD_SIGNATURE) {
933-
dev_err(&spi_device->dev, "Invalid signature (0x%04X)\n",
933+
dev_err(&spi->dev, "Invalid signature (0x%04X)\n",
934934
signature);
935935
free_netdev(qcaspi_devs);
936936
return -EFAULT;
937937
}
938938
}
939939

940940
if (register_netdev(qcaspi_devs)) {
941-
dev_info(&spi_device->dev, "Unable to register net device %s\n",
941+
dev_info(&spi->dev, "Unable to register net device %s\n",
942942
qcaspi_devs->name);
943943
free_netdev(qcaspi_devs);
944944
return -EFAULT;
945945
}
946946

947-
spi_set_drvdata(spi_device, qcaspi_devs);
947+
spi_set_drvdata(spi, qcaspi_devs);
948948

949949
qcaspi_init_device_debugfs(qca);
950950

951951
return 0;
952952
}
953953

954954
static int
955-
qca_spi_remove(struct spi_device *spi_device)
955+
qca_spi_remove(struct spi_device *spi)
956956
{
957-
struct net_device *qcaspi_devs = spi_get_drvdata(spi_device);
957+
struct net_device *qcaspi_devs = spi_get_drvdata(spi);
958958
struct qcaspi *qca = netdev_priv(qcaspi_devs);
959959

960960
qcaspi_remove_device_debugfs(qca);

0 commit comments

Comments
 (0)