mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 03:09:08 +08:00
generic: ar8216: use dynamically allocated private data in ar8216_probe
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34242
This commit is contained in:
parent
169e596268
commit
4b17323b51
@ -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.phy = pdev;
|
||||
return ar8216_id_chip(&priv);
|
||||
priv = kzalloc(sizeof(struct ar8216_priv), GFP_KERNEL);
|
||||
if (priv == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
priv->phy = pdev;
|
||||
|
||||
ret = ar8216_id_chip(priv);
|
||||
kfree(priv);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user