Commit c95e224f authored by Suzuki K Poulose's avatar Suzuki K Poulose Committed by Greg Kroah-Hartman

coresight: catu: Cleanup device specific data

Switch to using the CoreSight device instead of the real
amba device.
Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9dd0a920
...@@ -408,13 +408,14 @@ static int catu_enable_hw(struct catu_drvdata *drvdata, void *data) ...@@ -408,13 +408,14 @@ static int catu_enable_hw(struct catu_drvdata *drvdata, void *data)
int rc; int rc;
u32 control, mode; u32 control, mode;
struct etr_buf *etr_buf = data; struct etr_buf *etr_buf = data;
struct device *dev = &drvdata->csdev->dev;
if (catu_wait_for_ready(drvdata)) if (catu_wait_for_ready(drvdata))
dev_warn(drvdata->dev, "Timeout while waiting for READY\n"); dev_warn(dev, "Timeout while waiting for READY\n");
control = catu_read_control(drvdata); control = catu_read_control(drvdata);
if (control & BIT(CATU_CONTROL_ENABLE)) { if (control & BIT(CATU_CONTROL_ENABLE)) {
dev_warn(drvdata->dev, "CATU is already enabled\n"); dev_warn(dev, "CATU is already enabled\n");
return -EBUSY; return -EBUSY;
} }
...@@ -440,7 +441,7 @@ static int catu_enable_hw(struct catu_drvdata *drvdata, void *data) ...@@ -440,7 +441,7 @@ static int catu_enable_hw(struct catu_drvdata *drvdata, void *data)
catu_write_irqen(drvdata, 0); catu_write_irqen(drvdata, 0);
catu_write_mode(drvdata, mode); catu_write_mode(drvdata, mode);
catu_write_control(drvdata, control); catu_write_control(drvdata, control);
dev_dbg(drvdata->dev, "Enabled in %s mode\n", dev_dbg(dev, "Enabled in %s mode\n",
(mode == CATU_MODE_PASS_THROUGH) ? (mode == CATU_MODE_PASS_THROUGH) ?
"Pass through" : "Pass through" :
"Translate"); "Translate");
...@@ -461,15 +462,16 @@ static int catu_enable(struct coresight_device *csdev, void *data) ...@@ -461,15 +462,16 @@ static int catu_enable(struct coresight_device *csdev, void *data)
static int catu_disable_hw(struct catu_drvdata *drvdata) static int catu_disable_hw(struct catu_drvdata *drvdata)
{ {
int rc = 0; int rc = 0;
struct device *dev = &drvdata->csdev->dev;
catu_write_control(drvdata, 0); catu_write_control(drvdata, 0);
coresight_disclaim_device_unlocked(drvdata->base); coresight_disclaim_device_unlocked(drvdata->base);
if (catu_wait_for_ready(drvdata)) { if (catu_wait_for_ready(drvdata)) {
dev_info(drvdata->dev, "Timeout while waiting for READY\n"); dev_info(dev, "Timeout while waiting for READY\n");
rc = -EAGAIN; rc = -EAGAIN;
} }
dev_dbg(drvdata->dev, "Disabled\n"); dev_dbg(dev, "Disabled\n");
return rc; return rc;
} }
...@@ -519,7 +521,6 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -519,7 +521,6 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id)
goto out; goto out;
} }
drvdata->dev = dev;
dev_set_drvdata(dev, drvdata); dev_set_drvdata(dev, drvdata);
base = devm_ioremap_resource(dev, &adev->res); base = devm_ioremap_resource(dev, &adev->res);
if (IS_ERR(base)) { if (IS_ERR(base)) {
......
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
#define CATU_IRQEN_OFF 0x0 #define CATU_IRQEN_OFF 0x0
struct catu_drvdata { struct catu_drvdata {
struct device *dev;
void __iomem *base; void __iomem *base;
struct coresight_device *csdev; struct coresight_device *csdev;
int irq; int irq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment