drivers: net: xgene: Remove acpi_has_method() calls
acpi_evaluate_object will already return an error if the needed method does not exist. Remove unnecessary acpi_has_method() calls and check the returned acpi_status for failure instead. Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3e3bb69589
commit
570d785ba4
@ -694,6 +694,7 @@ bool xgene_ring_mgr_init(struct xgene_enet_pdata *p)
|
|||||||
static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
|
static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdata->pdev->dev;
|
struct device *dev = &pdata->pdev->dev;
|
||||||
|
acpi_status status;
|
||||||
|
|
||||||
if (!xgene_ring_mgr_init(pdata))
|
if (!xgene_ring_mgr_init(pdata))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@ -712,11 +713,9 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
|
|||||||
udelay(5);
|
udelay(5);
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONFIG_ACPI
|
#ifdef CONFIG_ACPI
|
||||||
if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev), "_RST")) {
|
status = acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
|
||||||
acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
|
"_RST", NULL, NULL);
|
||||||
"_RST", NULL, NULL);
|
if (ACPI_FAILURE(status)) {
|
||||||
} else if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev),
|
|
||||||
"_INI")) {
|
|
||||||
acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
|
acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
|
||||||
"_INI", NULL, NULL);
|
"_INI", NULL, NULL);
|
||||||
}
|
}
|
||||||
|
@ -437,6 +437,7 @@ static void xgene_sgmac_tx_disable(struct xgene_enet_pdata *p)
|
|||||||
static int xgene_enet_reset(struct xgene_enet_pdata *p)
|
static int xgene_enet_reset(struct xgene_enet_pdata *p)
|
||||||
{
|
{
|
||||||
struct device *dev = &p->pdev->dev;
|
struct device *dev = &p->pdev->dev;
|
||||||
|
acpi_status status;
|
||||||
|
|
||||||
if (!xgene_ring_mgr_init(p))
|
if (!xgene_ring_mgr_init(p))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@ -460,12 +461,12 @@ static int xgene_enet_reset(struct xgene_enet_pdata *p)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONFIG_ACPI
|
#ifdef CONFIG_ACPI
|
||||||
if (acpi_has_method(ACPI_HANDLE(&p->pdev->dev), "_RST"))
|
status = acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
|
||||||
acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
|
"_RST", NULL, NULL);
|
||||||
"_RST", NULL, NULL);
|
if (ACPI_FAILURE(status)) {
|
||||||
else if (acpi_has_method(ACPI_HANDLE(&p->pdev->dev), "_INI"))
|
|
||||||
acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
|
acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
|
||||||
"_INI", NULL, NULL);
|
"_INI", NULL, NULL);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,6 +380,7 @@ static void xgene_xgmac_tx_disable(struct xgene_enet_pdata *pdata)
|
|||||||
static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
|
static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdata->pdev->dev;
|
struct device *dev = &pdata->pdev->dev;
|
||||||
|
acpi_status status;
|
||||||
|
|
||||||
if (!xgene_ring_mgr_init(pdata))
|
if (!xgene_ring_mgr_init(pdata))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@ -393,11 +394,9 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
|
|||||||
udelay(5);
|
udelay(5);
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONFIG_ACPI
|
#ifdef CONFIG_ACPI
|
||||||
if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev), "_RST")) {
|
status = acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
|
||||||
acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
|
"_RST", NULL, NULL);
|
||||||
"_RST", NULL, NULL);
|
if (ACPI_FAILURE(status)) {
|
||||||
} else if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev),
|
|
||||||
"_INI")) {
|
|
||||||
acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
|
acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
|
||||||
"_INI", NULL, NULL);
|
"_INI", NULL, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user