mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
generic: rtl8366: introduce rtl8366_smi_alloc
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22195 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -741,13 +741,27 @@ static void rtl8366_smi_mii_cleanup(struct rtl8366_smi *smi)
|
||||
mdiobus_free(smi->mii_bus);
|
||||
}
|
||||
|
||||
struct rtl8366_smi *rtl8366_smi_alloc(struct device *parent)
|
||||
{
|
||||
struct rtl8366_smi *smi;
|
||||
|
||||
BUG_ON(!parent);
|
||||
|
||||
smi = kzalloc(sizeof(*smi), GFP_KERNEL);
|
||||
if (!smi) {
|
||||
dev_err(parent, "no memory for private data\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
smi->parent = parent;
|
||||
return smi;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rtl8366_smi_alloc);
|
||||
|
||||
int rtl8366_smi_init(struct rtl8366_smi *smi)
|
||||
{
|
||||
int err;
|
||||
|
||||
if (!smi->parent)
|
||||
return -EINVAL;
|
||||
|
||||
if (!smi->ops)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user