projects
/
openwrt
/
staging
/
yousong.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
169e596
)
generic: ar8216: use dynamically allocated private data in ar8216_probe
author
Gabor Juhos
<
[email protected]
>
Sun, 18 Nov 2012 12:26:34 +0000
(12:26 +0000)
committer
Gabor Juhos
<
[email protected]
>
Sun, 18 Nov 2012 12:26:34 +0000
(12:26 +0000)
Signed-off-by: Gabor Juhos <
[email protected]
>
SVN-Revision: 34242
target/linux/generic/files/drivers/net/phy/ar8216.c
patch
|
blob
|
history
diff --git
a/target/linux/generic/files/drivers/net/phy/ar8216.c
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 4df2dbbdb59f67f4904d186626205978d6ce58f5..5a8a9381891cca96dba398adcf3f2d968c4ad9a5 100644
(file)
--- a/
target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/
target/linux/generic/files/drivers/net/phy/ar8216.c
@@
-1481,10
+1481,19
@@
ar8216_config_aneg(struct phy_device *phydev)
static int
ar8216_probe(struct phy_device *pdev)
{
- struct ar8216_priv priv;
+ struct ar8216_priv *priv;
+ int ret;
+
+ priv = kzalloc(sizeof(struct ar8216_priv), GFP_KERNEL);
+ if (priv == NULL)
+ return -ENOMEM;
+
+ priv->phy = pdev;
- priv.phy = pdev;
- return ar8216_id_chip(&priv);
+ ret = ar8216_id_chip(priv);
+ kfree(priv);
+
+ return ret;
}
static void