coresight: catu: Cleanup device specific data
Switch to using the CoreSight device instead of the real amba device. Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9dd0a92097
commit
c95e224fee
|
@ -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)
|
||||||
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)
|
||||||
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)
|
||||||
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 @@
|
||||||
#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;
|
||||||
|
|
Loading…
Reference in New Issue