Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224489
b: refs/heads/master
c: 293bb1c
h: refs/heads/master
i:
  224487: 3f7c59b
v: v3
  • Loading branch information
Giuseppe CAVALLARO authored and David S. Miller committed Nov 24, 2010
1 parent 1c60f68 commit 2741a41
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9dfeb4d953f914bd3bb56ce60e22ee84687399ce
refs/heads/master: 293bb1c41b728d4aa248fe8a0acd2b9066ff5c34
22 changes: 0 additions & 22 deletions trunk/drivers/net/stmmac/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,6 @@ struct stmmac_priv {
struct plat_stmmacenet_data *plat;
};

#ifdef CONFIG_STM_DRIVERS
#include <linux/stm/pad.h>
static inline int stmmac_claim_resource(struct platform_device *pdev)
{
int ret = 0;
struct plat_stmmacenet_data *plat_dat = pdev->dev.platform_data;

/* Pad routing setup */
if (IS_ERR(devm_stm_pad_claim(&pdev->dev, plat_dat->pad_config,
dev_name(&pdev->dev)))) {
printk(KERN_ERR "%s: Failed to request pads!\n", __func__);
ret = -ENODEV;
}
return ret;
}
#else
static inline int stmmac_claim_resource(struct platform_device *pdev)
{
return 0;
}
#endif

extern int stmmac_mdio_unregister(struct net_device *ndev);
extern int stmmac_mdio_register(struct net_device *ndev);
extern void stmmac_set_ethtool_ops(struct net_device *netdev);
Expand Down
18 changes: 13 additions & 5 deletions trunk/drivers/net/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
struct resource *res;
void __iomem *addr = NULL;
struct net_device *ndev = NULL;
struct stmmac_priv *priv;
struct stmmac_priv *priv = NULL;
struct plat_stmmacenet_data *plat_dat;

pr_info("STMMAC driver:\n\tplatform registration... ");
Expand Down Expand Up @@ -1708,10 +1708,12 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
/* Set the I/O base addr */
ndev->base_addr = (unsigned long)addr;

/* Verify embedded resource for the platform */
ret = stmmac_claim_resource(pdev);
if (ret < 0)
goto out;
/* Custom initialisation */
if (priv->plat->init) {
ret = priv->plat->init(pdev);
if (unlikely(ret))
goto out;
}

/* MAC HW revice detection */
ret = stmmac_mac_device_setup(ndev);
Expand Down Expand Up @@ -1745,6 +1747,9 @@ static int stmmac_dvr_probe(struct platform_device *pdev)

out:
if (ret < 0) {
if (priv->plat->exit)
priv->plat->exit(pdev);

platform_set_drvdata(pdev, NULL);
release_mem_region(res->start, resource_size(res));
if (addr != NULL)
Expand Down Expand Up @@ -1778,6 +1783,9 @@ static int stmmac_dvr_remove(struct platform_device *pdev)

stmmac_mdio_unregister(ndev);

if (priv->plat->exit)
priv->plat->exit(pdev);

platform_set_drvdata(pdev, NULL);
unregister_netdev(ndev);

Expand Down
6 changes: 3 additions & 3 deletions trunk/include/linux/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ struct plat_stmmacenet_data {
int pmt;
void (*fix_mac_speed)(void *priv, unsigned int speed);
void (*bus_setup)(void __iomem *ioaddr);
#ifdef CONFIG_STM_DRIVERS
struct stm_pad_config *pad_config;
#endif
int (*init)(struct platform_device *pdev);
void (*exit)(struct platform_device *pdev);
void *custom_cfg;
void *bsp_priv;
};

Expand Down

0 comments on commit 2741a41

Please sign in to comment.