Commit aceee63a authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Leon Romanovsky
Browse files

RDMA/bnxt_re: Remove some dead code



If the probe succeeds, then auxiliary_get_drvdata() can't return a NULL
pointer.

So several NULL checks can be removed to simplify code.

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/f02eb630734ee530315dce9f60b078f631ae93d0.1730477345.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent cf90a4d1
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -300,9 +300,6 @@ static void bnxt_re_shutdown(struct auxiliary_device *adev)
	struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(adev);
	struct bnxt_re_dev *rdev;

	if (!en_info)
		return;

	rdev = en_info->rdev;
	ib_unregister_device(&rdev->ibdev);
	bnxt_re_dev_uninit(rdev, BNXT_RE_COMPLETE_REMOVE);
@@ -316,9 +313,6 @@ static void bnxt_re_stop_irq(void *handle)
	struct bnxt_qplib_nq *nq;
	int indx;

	if (!en_info)
		return;

	rdev = en_info->rdev;
	rcfw = &rdev->rcfw;

@@ -339,9 +333,6 @@ static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent)
	struct bnxt_qplib_nq *nq;
	int indx, rc;

	if (!en_info)
		return;

	rdev = en_info->rdev;
	msix_ent = rdev->en_dev->msix_entries;
	rcfw = &rdev->rcfw;
@@ -1991,10 +1982,6 @@ static void bnxt_re_remove(struct auxiliary_device *adev)
	struct bnxt_re_dev *rdev;

	mutex_lock(&bnxt_re_mutex);
	if (!en_info) {
		mutex_unlock(&bnxt_re_mutex);
		return;
	}
	rdev = en_info->rdev;

	if (rdev)
@@ -2043,9 +2030,6 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
	struct bnxt_en_dev *en_dev;
	struct bnxt_re_dev *rdev;

	if (!en_info)
		return 0;

	rdev = en_info->rdev;
	en_dev = en_info->en_dev;
	mutex_lock(&bnxt_re_mutex);
@@ -2090,9 +2074,6 @@ static int bnxt_re_resume(struct auxiliary_device *adev)
	struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(adev);
	struct bnxt_re_dev *rdev;

	if (!en_info)
		return 0;

	mutex_lock(&bnxt_re_mutex);
	/* L2 driver may invoke this callback during device recovery, resume.
	 * reset. Current RoCE driver doesn't recover the device in case of