Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ca8cc6f authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller
Browse files

s390: remove cu3088 layer for lcs and ctcm



The cu3088-driver used as common base for lcs- and ctcm-devices
makes it difficult to assign the appropriate driver to an lcs-device
or a ctcm-device. This patch eliminates the cu3088-driver and thus
the root device "cu3088". Path /sys/devices/cu3088 is replaced with
the pathes /sys/devices/lcs and /sys/devices/ctcm.

Patch is based on a proposal from Cornelia Huck.

Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1e1815be
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3,11 +3,11 @@
#

ctcm-y += ctcm_main.o ctcm_fsms.o ctcm_mpc.o ctcm_sysfs.o ctcm_dbug.o
obj-$(CONFIG_CTCM) += ctcm.o fsm.o cu3088.o
obj-$(CONFIG_CTCM) += ctcm.o fsm.o
obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o
obj-$(CONFIG_SMSGIUCV) += smsgiucv.o
obj-$(CONFIG_LCS) += lcs.o cu3088.o
obj-$(CONFIG_CLAW) += claw.o cu3088.o
obj-$(CONFIG_LCS) += lcs.o
obj-$(CONFIG_CLAW) += claw.o
qeth-y += qeth_core_sys.o qeth_core_main.o qeth_core_mpc.o
obj-$(CONFIG_QETH) += qeth.o
qeth_l2-y += qeth_l2_main.o
+72 −10
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@
#include <linux/timer.h>
#include <linux/types.h>

#include "cu3088.h"
#include "claw.h"

/*
@@ -258,6 +257,9 @@ static int claw_pm_prepare(struct ccwgroup_device *gdev)
	return -EPERM;
}

/* the root device for claw group devices */
static struct device *claw_root_dev;

/* ccwgroup table  */

static struct ccwgroup_driver claw_group_driver = {
@@ -272,6 +274,47 @@ static struct ccwgroup_driver claw_group_driver = {
	.prepare     = claw_pm_prepare,
};

static struct ccw_device_id claw_ids[] = {
	{CCW_DEVICE(0x3088, 0x61), .driver_info = claw_channel_type_claw},
	{},
};
MODULE_DEVICE_TABLE(ccw, claw_ids);

static struct ccw_driver claw_ccw_driver = {
	.owner	= THIS_MODULE,
	.name	= "claw",
	.ids	= claw_ids,
	.probe	= ccwgroup_probe_ccwdev,
	.remove	= ccwgroup_remove_ccwdev,
};

static ssize_t
claw_driver_group_store(struct device_driver *ddrv, const char *buf,
			size_t count)
{
	int err;
	err = ccwgroup_create_from_string(claw_root_dev,
					  claw_group_driver.driver_id,
					  &claw_ccw_driver, 3, buf);
	return err ? err : count;
}

static DRIVER_ATTR(group, 0200, NULL, claw_driver_group_store);

static struct attribute *claw_group_attrs[] = {
	&driver_attr_group.attr,
	NULL,
};

static struct attribute_group claw_group_attr_group = {
	.attrs = claw_group_attrs,
};

static struct attribute_group *claw_group_attr_groups[] = {
	&claw_group_attr_group,
	NULL,
};

/*
*       Key functions
*/
@@ -3326,7 +3369,11 @@ claw_remove_files(struct device *dev)
static void __exit
claw_cleanup(void)
{
	unregister_cu3088_discipline(&claw_group_driver);
	driver_remove_file(&claw_group_driver.driver,
			   &driver_attr_group);
	ccwgroup_driver_unregister(&claw_group_driver);
	ccw_driver_unregister(&claw_ccw_driver);
	root_device_unregister(claw_root_dev);
	claw_unregister_debug_facility();
	pr_info("Driver unloaded\n");

@@ -3348,16 +3395,31 @@ claw_init(void)
	if (ret) {
		pr_err("Registering with the S/390 debug feature"
			" failed with error code %d\n", ret);
		return ret;
		goto out_err;
	}
	CLAW_DBF_TEXT(2, setup, "init_mod");
	ret = register_cu3088_discipline(&claw_group_driver);
	if (ret) {
	claw_root_dev = root_device_register("qeth");
	ret = IS_ERR(claw_root_dev) ? PTR_ERR(claw_root_dev) : 0;
	if (ret)
		goto register_err;
	ret = ccw_driver_register(&claw_ccw_driver);
	if (ret)
		goto ccw_err;
	claw_group_driver.driver.groups = claw_group_attr_groups;
	ret = ccwgroup_driver_register(&claw_group_driver);
	if (ret)
		goto ccwgroup_err;
	return 0;

ccwgroup_err:
	ccw_driver_unregister(&claw_ccw_driver);
ccw_err:
	root_device_unregister(claw_root_dev);
register_err:
	CLAW_DBF_TEXT(2, setup, "init_bad");
	claw_unregister_debug_facility();
		pr_err("Registering with the cu3088 device driver failed "
			   "with error code %d\n", ret);
	}
out_err:
	pr_err("Initializing the claw device driver failed\n");
	return ret;
}

+12 −0
Original line number Diff line number Diff line
@@ -129,6 +129,18 @@ static inline int claw_dbf_passes(debug_info_t *dbf_grp, int level)
		} \
	} while (0)

/**
 * Enum for classifying detected devices.
 */
enum claw_channel_types {
	/* Device is not a channel  */
	claw_channel_type_none,

	/* Device is a CLAW channel device */
	claw_channel_type_claw
};


/*******************************************************
*  Define Control Blocks                               *
*                                                      *
+0 −1
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@
#include <asm/idals.h>

#include "fsm.h"
#include "cu3088.h"

#include "ctcm_dbug.h"
#include "ctcm_main.h"
+0 −1
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@
#include <asm/idals.h>

#include "fsm.h"
#include "cu3088.h"
#include "ctcm_main.h"

/*
Loading