This patch deactivates the statistics, adds a missing lock
initialization and fixes a waring.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41511
3c298f89-4303-0410-b956-
a3cf2f4a3e73
struct adm6996_priv *priv = to_adm(dev);
u16 reg = 0;
struct adm6996_priv *priv = to_adm(dev);
u16 reg = 0;
if (port >= ADM_NUM_PORTS)
return -EINVAL;
if (port >= ADM_NUM_PORTS)
return -EINVAL;
-static const struct switch_dev_ops adm6996_ops = {
+static struct switch_dev_ops adm6996_ops = {
.attr_global = {
.attr = adm6996_globals,
.n_attr = ARRAY_SIZE(adm6996_globals),
.attr_global = {
.attr = adm6996_globals,
.n_attr = ARRAY_SIZE(adm6996_globals),
swdev->ops = &adm6996_ops;
swdev->alias = alias;
swdev->ops = &adm6996_ops;
swdev->alias = alias;
+ /* The ADM6996L connected through GPIOs does not support any switch
+ status calls */
+ if (priv->model == ADM6996L) {
+ adm6996_ops.attr_port.n_attr = 0;
+ adm6996_ops.get_port_link = NULL;
+ }
+
pr_info ("%s: %s model PHY found.\n", alias, swdev->name);
mutex_lock(&priv->reg_mutex);
pr_info ("%s: %s model PHY found.\n", alias, swdev->name);
mutex_lock(&priv->reg_mutex);
return -ENOMEM;
mutex_init(&priv->reg_mutex);
return -ENOMEM;
mutex_init(&priv->reg_mutex);
+ mutex_init(&priv->mib_lock);
priv->eecs = pdata->eecs;
priv->eedi = pdata->eedi;
priv->eecs = pdata->eecs;
priv->eedi = pdata->eedi;