Commit c42257d6 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Heiko Carstens
Browse files

s390/zcrypt: remove gratuitious NULL check in .remove() callbacks



As .remove() is only called after a successful .probe() call, we can
trust that the drvdata is valid.

Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent b5adbbf8
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -132,7 +132,6 @@ static void zcrypt_cex2a_card_remove(struct ap_device *ap_dev)
{
	struct zcrypt_card *zc = dev_get_drvdata(&ap_dev->device);

	if (zc)
	zcrypt_card_unregister(zc);
}

@@ -192,7 +191,6 @@ static void zcrypt_cex2a_queue_remove(struct ap_device *ap_dev)
{
	struct zcrypt_queue *zq = dev_get_drvdata(&ap_dev->device);

	if (zq)
	zcrypt_queue_unregister(zq);
}

+4 −4
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ static void zcrypt_cex2c_card_remove(struct ap_device *ap_dev)

	if (ap_test_bit(&ac->functions, AP_FUNC_COPRO))
		sysfs_remove_group(&ap_dev->device.kobj, &cca_card_attr_grp);
	if (zc)

	zcrypt_card_unregister(zc);
}

@@ -387,7 +387,7 @@ static void zcrypt_cex2c_queue_remove(struct ap_device *ap_dev)

	if (ap_test_bit(&aq->card->functions, AP_FUNC_COPRO))
		sysfs_remove_group(&ap_dev->device.kobj, &cca_queue_attr_grp);
	if (zq)

	zcrypt_queue_unregister(zq);
}

+4 −4
Original line number Diff line number Diff line
@@ -575,7 +575,7 @@ static void zcrypt_cex4_card_remove(struct ap_device *ap_dev)
		sysfs_remove_group(&ap_dev->device.kobj, &cca_card_attr_grp);
	else if (ap_test_bit(&ac->functions, AP_FUNC_EP11))
		sysfs_remove_group(&ap_dev->device.kobj, &ep11_card_attr_grp);
	if (zc)

	zcrypt_card_unregister(zc);
}

@@ -665,7 +665,7 @@ static void zcrypt_cex4_queue_remove(struct ap_device *ap_dev)
		sysfs_remove_group(&ap_dev->device.kobj, &cca_queue_attr_grp);
	else if (ap_test_bit(&aq->card->functions, AP_FUNC_EP11))
		sysfs_remove_group(&ap_dev->device.kobj, &ep11_queue_attr_grp);
	if (zq)

	zcrypt_queue_unregister(zq);
}