extern const struct qeth_discipline qeth_l3_discipline;
 extern const struct ethtool_ops qeth_ethtool_ops;
 extern const struct ethtool_ops qeth_osn_ethtool_ops;
-extern const struct attribute_group *qeth_generic_attr_groups[];
-extern const struct attribute_group *qeth_osn_attr_groups[];
-extern const struct attribute_group qeth_device_attr_group;
-extern const struct attribute_group qeth_device_blkt_group;
+extern const struct attribute_group *qeth_dev_groups[];
+extern const struct attribute_group *qeth_osn_dev_groups[];
 extern const struct device_type qeth_generic_devtype;
 
 const char *qeth_get_cardname_short(struct qeth_card *);
 
 
 const struct device_type qeth_generic_devtype = {
        .name = "qeth_generic",
-       .groups = qeth_generic_attr_groups,
 };
 EXPORT_SYMBOL_GPL(qeth_generic_devtype);
 
 static const struct device_type qeth_osn_devtype = {
        .name = "qeth_osn",
-       .groups = qeth_osn_attr_groups,
 };
 
 #define DBF_NAME_LEN   20
        if (rc)
                goto err_chp_desc;
 
+       if (IS_OSN(card))
+               gdev->dev.groups = qeth_osn_dev_groups;
+       else
+               gdev->dev.groups = qeth_dev_groups;
+
        enforced_disc = qeth_enforce_discipline(card);
        switch (enforced_disc) {
        case QETH_DISCIPLINE_UNDETERMINED:
 
        &dev_attr_inter_jumbo.attr,
        NULL,
 };
-const struct attribute_group qeth_device_blkt_group = {
+
+static const struct attribute_group qeth_dev_blkt_group = {
        .name = "blkt",
        .attrs = qeth_blkt_device_attrs,
 };
-EXPORT_SYMBOL_GPL(qeth_device_blkt_group);
 
-static struct attribute *qeth_device_attrs[] = {
-       &dev_attr_state.attr,
-       &dev_attr_chpid.attr,
-       &dev_attr_if_name.attr,
-       &dev_attr_card_type.attr,
+static struct attribute *qeth_dev_extended_attrs[] = {
        &dev_attr_inbuf_size.attr,
        &dev_attr_portno.attr,
        &dev_attr_portname.attr,
        &dev_attr_priority_queueing.attr,
-       &dev_attr_buffer_count.attr,
-       &dev_attr_recover.attr,
        &dev_attr_performance_stats.attr,
        &dev_attr_layer2.attr,
        &dev_attr_isolation.attr,
        &dev_attr_switch_attrs.attr,
        NULL,
 };
-const struct attribute_group qeth_device_attr_group = {
-       .attrs = qeth_device_attrs,
-};
-EXPORT_SYMBOL_GPL(qeth_device_attr_group);
 
-const struct attribute_group *qeth_generic_attr_groups[] = {
-       &qeth_device_attr_group,
-       &qeth_device_blkt_group,
-       NULL,
+static const struct attribute_group qeth_dev_extended_group = {
+       .attrs = qeth_dev_extended_attrs,
 };
 
-static struct attribute *qeth_osn_device_attrs[] = {
+static struct attribute *qeth_dev_attrs[] = {
        &dev_attr_state.attr,
        &dev_attr_chpid.attr,
        &dev_attr_if_name.attr,
        &dev_attr_recover.attr,
        NULL,
 };
-static struct attribute_group qeth_osn_device_attr_group = {
-       .attrs = qeth_osn_device_attrs,
+
+static const struct attribute_group qeth_dev_group = {
+       .attrs = qeth_dev_attrs,
 };
-const struct attribute_group *qeth_osn_attr_groups[] = {
-       &qeth_osn_device_attr_group,
+
+const struct attribute_group *qeth_osn_dev_groups[] = {
+       &qeth_dev_group,
+       NULL,
+};
+
+const struct attribute_group *qeth_dev_groups[] = {
+       &qeth_dev_group,
+       &qeth_dev_extended_group,
+       &qeth_dev_blkt_group,
        NULL,
 };
 
 
 extern const struct attribute_group *qeth_l2_attr_groups[];
 
-int qeth_l2_create_device_attributes(struct device *);
-void qeth_l2_remove_device_attributes(struct device *);
 int qeth_bridgeport_query_ports(struct qeth_card *card,
                                enum qeth_sbp_roles *role,
                                enum qeth_sbp_states *state);
 
        mutex_init(&card->sbp_lock);
 
        if (gdev->dev.type == &qeth_generic_devtype) {
-               rc = qeth_l2_create_device_attributes(&gdev->dev);
+               rc = device_add_groups(&gdev->dev, qeth_l2_attr_groups);
                if (rc)
                        return rc;
        }
        struct qeth_card *card = dev_get_drvdata(&gdev->dev);
 
        if (gdev->dev.type == &qeth_generic_devtype)
-               qeth_l2_remove_device_attributes(&gdev->dev);
+               device_remove_groups(&gdev->dev, qeth_l2_attr_groups);
        qeth_set_allowed_threads(card, 0, 1);
        wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
 
 
        .name = "vnicc",
 };
 
-static const struct attribute_group *qeth_l2_only_attr_groups[] = {
-       &qeth_l2_bridgeport_attr_group,
-       &qeth_l2_vnicc_attr_group,
-       NULL,
-};
-
-int qeth_l2_create_device_attributes(struct device *dev)
-{
-       return sysfs_create_groups(&dev->kobj, qeth_l2_only_attr_groups);
-}
-
-void qeth_l2_remove_device_attributes(struct device *dev)
-{
-       sysfs_remove_groups(&dev->kobj, qeth_l2_only_attr_groups);
-}
-
 const struct attribute_group *qeth_l2_attr_groups[] = {
-       &qeth_device_attr_group,
-       &qeth_device_blkt_group,
-       /* l2 specific, see qeth_l2_only_attr_groups: */
        &qeth_l2_bridgeport_attr_group,
        &qeth_l2_vnicc_attr_group,
        NULL,
 
 
 int qeth_l3_ipaddr_to_string(enum qeth_prot_versions proto, const u8 *addr,
                             char *buf);
-int qeth_l3_create_device_attributes(struct device *);
-void qeth_l3_remove_device_attributes(struct device *);
 int qeth_l3_setrouting_v4(struct qeth_card *);
 int qeth_l3_setrouting_v6(struct qeth_card *);
 int qeth_l3_add_ipato_entry(struct qeth_card *, struct qeth_ipato_entry *);
 
                return -ENOMEM;
 
        if (gdev->dev.type == &qeth_generic_devtype) {
-               rc = qeth_l3_create_device_attributes(&gdev->dev);
+               rc = device_add_groups(&gdev->dev, qeth_l3_attr_groups);
                if (rc) {
                        destroy_workqueue(card->cmd_wq);
                        return rc;
        struct qeth_card *card = dev_get_drvdata(&cgdev->dev);
 
        if (cgdev->dev.type == &qeth_generic_devtype)
-               qeth_l3_remove_device_attributes(&cgdev->dev);
+               device_remove_groups(&cgdev->dev, qeth_l3_attr_groups);
 
        qeth_set_allowed_threads(card, 0, 1);
        wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
 
        .attrs = qeth_rxip_device_attrs,
 };
 
-static const struct attribute_group *qeth_l3_only_attr_groups[] = {
-       &qeth_l3_device_attr_group,
-       &qeth_device_ipato_group,
-       &qeth_device_vipa_group,
-       &qeth_device_rxip_group,
-       NULL,
-};
-
-int qeth_l3_create_device_attributes(struct device *dev)
-{
-       return sysfs_create_groups(&dev->kobj, qeth_l3_only_attr_groups);
-}
-
-void qeth_l3_remove_device_attributes(struct device *dev)
-{
-       sysfs_remove_groups(&dev->kobj, qeth_l3_only_attr_groups);
-}
-
 const struct attribute_group *qeth_l3_attr_groups[] = {
-       &qeth_device_attr_group,
-       &qeth_device_blkt_group,
-       /* l3 specific, see qeth_l3_only_attr_groups: */
        &qeth_l3_device_attr_group,
        &qeth_device_ipato_group,
        &qeth_device_vipa_group,