Commit bc0f1493 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Bjorn Andersson
Browse files

soc: qcom: apr: Drop redundant check in .remove()



The remove callback is only called by the driver core if there is a
driver to unbind, so there is no need to check dev->driver to be
non-NULL.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220618203913.35785-1-u.kleine-koenig@pengutronix.de
parent c19698a9
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -377,18 +377,15 @@ static int apr_device_probe(struct device *dev)
static void apr_device_remove(struct device *dev)
{
	struct apr_device *adev = to_apr_device(dev);
	struct apr_driver *adrv;
	struct apr_driver *adrv = to_apr_driver(dev->driver);
	struct packet_router *apr = dev_get_drvdata(adev->dev.parent);

	if (dev->driver) {
		adrv = to_apr_driver(dev->driver);
	if (adrv->remove)
		adrv->remove(adev);
	spin_lock(&apr->svcs_lock);
	idr_remove(&apr->svcs_idr, adev->svc.id);
	spin_unlock(&apr->svcs_lock);
}
}

static int apr_uevent(struct device *dev, struct kobj_uevent_env *env)
{