mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
net: lan743x: Remove extranous gotos
The gotos for cleanup aren't required, the function might as well just return the actual error code. Signed-off-by: Moritz Fischer <moritzf@google.com> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
a92fb5c034
commit
0f0f586868
@@ -160,16 +160,13 @@ static int lan743x_csr_init(struct lan743x_adapter *adapter)
|
|||||||
{
|
{
|
||||||
struct lan743x_csr *csr = &adapter->csr;
|
struct lan743x_csr *csr = &adapter->csr;
|
||||||
resource_size_t bar_start, bar_length;
|
resource_size_t bar_start, bar_length;
|
||||||
int result;
|
|
||||||
|
|
||||||
bar_start = pci_resource_start(adapter->pdev, 0);
|
bar_start = pci_resource_start(adapter->pdev, 0);
|
||||||
bar_length = pci_resource_len(adapter->pdev, 0);
|
bar_length = pci_resource_len(adapter->pdev, 0);
|
||||||
csr->csr_address = devm_ioremap(&adapter->pdev->dev,
|
csr->csr_address = devm_ioremap(&adapter->pdev->dev,
|
||||||
bar_start, bar_length);
|
bar_start, bar_length);
|
||||||
if (!csr->csr_address) {
|
if (!csr->csr_address)
|
||||||
result = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto clean_up;
|
|
||||||
}
|
|
||||||
|
|
||||||
csr->id_rev = lan743x_csr_read(adapter, ID_REV);
|
csr->id_rev = lan743x_csr_read(adapter, ID_REV);
|
||||||
csr->fpga_rev = lan743x_csr_read(adapter, FPGA_REV);
|
csr->fpga_rev = lan743x_csr_read(adapter, FPGA_REV);
|
||||||
@@ -177,10 +174,8 @@ static int lan743x_csr_init(struct lan743x_adapter *adapter)
|
|||||||
"ID_REV = 0x%08X, FPGA_REV = %d.%d\n",
|
"ID_REV = 0x%08X, FPGA_REV = %d.%d\n",
|
||||||
csr->id_rev, FPGA_REV_GET_MAJOR_(csr->fpga_rev),
|
csr->id_rev, FPGA_REV_GET_MAJOR_(csr->fpga_rev),
|
||||||
FPGA_REV_GET_MINOR_(csr->fpga_rev));
|
FPGA_REV_GET_MINOR_(csr->fpga_rev));
|
||||||
if (!ID_REV_IS_VALID_CHIP_ID_(csr->id_rev)) {
|
if (!ID_REV_IS_VALID_CHIP_ID_(csr->id_rev))
|
||||||
result = -ENODEV;
|
return -ENODEV;
|
||||||
goto clean_up;
|
|
||||||
}
|
|
||||||
|
|
||||||
csr->flags = LAN743X_CSR_FLAG_SUPPORTS_INTR_AUTO_SET_CLR;
|
csr->flags = LAN743X_CSR_FLAG_SUPPORTS_INTR_AUTO_SET_CLR;
|
||||||
switch (csr->id_rev & ID_REV_CHIP_REV_MASK_) {
|
switch (csr->id_rev & ID_REV_CHIP_REV_MASK_) {
|
||||||
@@ -193,12 +188,7 @@ static int lan743x_csr_init(struct lan743x_adapter *adapter)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = lan743x_csr_light_reset(adapter);
|
return lan743x_csr_light_reset(adapter);
|
||||||
if (result)
|
|
||||||
goto clean_up;
|
|
||||||
return 0;
|
|
||||||
clean_up:
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lan743x_intr_software_isr(struct lan743x_adapter *adapter)
|
static void lan743x_intr_software_isr(struct lan743x_adapter *adapter)
|
||||||
|
Reference in New Issue
Block a user