devlink: don't do reporter recovery if the state is healthy

If reporter state is healthy, don't call into a driver for recover and
don't increase recovery count.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiri Pirko 2019-10-10 15:18:48 +02:00 коммит произвёл David S. Miller
Родитель 1635520aef
Коммит 402818205c
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -4851,6 +4851,9 @@ devlink_health_reporter_recover(struct devlink_health_reporter *reporter,
{
int err;
if (reporter->health_state == DEVLINK_HEALTH_REPORTER_STATE_HEALTHY)
return 0;
if (!reporter->ops->recover)
return -EOPNOTSUPP;