mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
coresight: etb10: Handle errors enabling the device
Prepare the etb10 driver to return errors in enabling the device. Cc: Mathieu Poirier <mathieu.poirier@linaro.org> 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
e2a1551a88
commit
62563e84a8
1 changed files with 13 additions and 5 deletions
|
@ -106,7 +106,7 @@ static unsigned int etb_get_buffer_depth(struct etb_drvdata *drvdata)
|
||||||
return depth;
|
return depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void etb_enable_hw(struct etb_drvdata *drvdata)
|
static void __etb_enable_hw(struct etb_drvdata *drvdata)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
u32 depth;
|
u32 depth;
|
||||||
|
@ -134,6 +134,12 @@ static void etb_enable_hw(struct etb_drvdata *drvdata)
|
||||||
CS_LOCK(drvdata->base);
|
CS_LOCK(drvdata->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int etb_enable_hw(struct etb_drvdata *drvdata)
|
||||||
|
{
|
||||||
|
__etb_enable_hw(drvdata);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int etb_enable_sysfs(struct coresight_device *csdev)
|
static int etb_enable_sysfs(struct coresight_device *csdev)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -152,8 +158,9 @@ static int etb_enable_sysfs(struct coresight_device *csdev)
|
||||||
if (drvdata->mode == CS_MODE_SYSFS)
|
if (drvdata->mode == CS_MODE_SYSFS)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
drvdata->mode = CS_MODE_SYSFS;
|
ret = etb_enable_hw(drvdata);
|
||||||
etb_enable_hw(drvdata);
|
if (!ret)
|
||||||
|
drvdata->mode = CS_MODE_SYSFS;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||||
|
@ -183,8 +190,9 @@ static int etb_enable_perf(struct coresight_device *csdev, void *data)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
drvdata->mode = CS_MODE_PERF;
|
ret = etb_enable_hw(drvdata);
|
||||||
etb_enable_hw(drvdata);
|
if (!ret)
|
||||||
|
drvdata->mode = CS_MODE_PERF;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue