From nobody Fri Jul 24 05:21:29 2026 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A606E346A1C for ; Thu, 23 Jul 2026 02:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784773606; cv=none; b=PqaweFRqBDeIopTuvkAeRsZwtqDMw24ZywYE0B0f2/qO+EWxYs7fbcOTd1Cbg3LFCN6BkEXhbDy9mkhZjsAZHP/YtOIoyfybqwFgJnnjo7KP2eTjw0ykRDfv4CaybK89xpAGy2lCKiytbycEC6CfNK/pqjKbnZVCu8AzPvCj50o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784773606; c=relaxed/simple; bh=rXHgfAoAlRJNqO01tv1FVpBejjD5IsknO2sNv306WQI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cEG3ARUYoORQxZvxMoo3gnjJDGhNDZLkF15lZ7S1IhEERgCmBoHzK/+80WUQ9iknvpSEJWskdfvhf4q2R5fS0PjFattEKAlDlH44Loiy8940IClyQjLJRqKRWWwB3zu6xhGAWKQdU+yvK+E9/uXz3ZyqQgUhjOLcoWFSKXl/Bxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CIdQv2dI; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CIdQv2dI" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2cab973140bso1921935ad.3 for ; Wed, 22 Jul 2026 19:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784773604; x=1785378404; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=WYun2sAk1Ltg3bxA8Zb4DCt+DIxSBg3GkrvAhMpsGp0=; b=CIdQv2dImlRf0tsLAYNG5hLQ8vPReLgagm3gNbDxCv6vNHkj+uI+yMKWMh3nrIXqMP SNHw+ytss8skH9qLCK0i8NW9qSexVH6TAfbiW+Nb5fBAyFPKl0EKK8itEDt7VV9LJQ5f ZNip2nzQmTjs3g+Im4Gjgqdpmg4ZOsKWPLBr8iwuQh94lJLkcBEG6aUV25cuggextdeT 2yQPATyyZbrPRDNxIYE8URwYs3eD6g6dVmJzGtgc82i+ZSHrT1GxiyKLESaSzU1Z+OKt il/YMssvcWUDYJ8UP70tIXtH+zhybBKoCXse+FTGxaHcn9zf/X24vtriRW1kT7JPvdk5 h4wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784773604; x=1785378404; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=WYun2sAk1Ltg3bxA8Zb4DCt+DIxSBg3GkrvAhMpsGp0=; b=IFHrUTsmR7q02H98/FQC9L/FpikO0XGZrbigNiSApGhj9+ACGF44Kp3QkTj+irRUxj 6kY7UaRKtm2vRXb5ZEEPCh6MSjfBFwKu4xTkdJVEumuV7AqP7tpzZXAVR/73Ywn9K+ol dEki1oUdtTAox5bC7yTg0wWyPNg9+jPgz5Plw8VQtWqKbxaqJt5sIEcns8N2JfdPi+or Zi/AVcXUzjGWxfbDOKppMUNKws3cbARd3IuYogikH93PjQEpQVwnWpoKeRXVV469GLuZ kJ3hV0Ryr6d+6K+G+ymv9TCicvDzcEZGJTplRJM6oVPySeDZplYKWpDcRf3hpH9LTV70 A8xA== X-Forwarded-Encrypted: i=1; AHgh+RpSS1KZvJ4BSKtdedDzAq3baR1Ay0rsYrdkLr6okfj2W3x76vatF4nLmAXnzrK+MCxeHBvO+rcp9rzjd3k=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1JcX7y3YnRuh+gwB6M2iCmYs9+MrErXdZBUHpVGnO5VMBbKlr mgfVF2nUDliEyBjHlum3nx9TZS1au/fpsChua/TBOyQMoCXLqNsqJ/w= X-Gm-Gg: AR+sD119JxRskduywK/IBNp7lc6l9cj6+aXiNt6c0uGHUVtZgkeKltZ8XS1ABlfQY/l lAMPP6/7FQ4WareLCsDVMayq+qHcikiefbL6j1SGpXpBGKIBADkdtP+ixnwk7w8ObKITudm4xBl Iz5YMp6GDfyb0ezymASwA2HxkiTfhanXrlynHQQTUrVMExDw0GMlys9AWH/YtVf6EDz7RtmHDyM pxQdBkPxCGsruolkMjNaUudscRnSSLAoW+/3bdV5kDJl5CMxBDRWhIZaDNb4F0t8UuXUPIk84BW xtStabDH3TIIibmtm5XT5BMgChJpRZqXljIilYO5nuVkuUx7ncvG0VXxq0b2o6tOrmDzByIBzOQ g4QgtTYQw1bY2w6m2uBh7ps3FJGqTLCpjUk6zSVvrcIdJSsUApfxiDx0lsVenySDrtOD6sN8K8j kY3S72j7i5bHbHb4d7tC8vn2hyxYtB6/DiEQE= X-Received: by 2002:a17:903:3c44:b0:2c9:ff83:41fa with SMTP id d9443c01a7336-2cfa6c5e315mr15614105ad.24.1784773603684; Wed, 22 Jul 2026 19:26:43 -0700 (PDT) Received: from t-rex ([2401:4900:addc:f847:290:7ec:f519:db36]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3147dc7d8fbsm15273195eec.10.2026.07.22.19.26.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 19:26:43 -0700 (PDT) From: kr494167@gmail.com To: linux@roeck-us.net, wim@linux-watchdog.org, cl634@andestech.com Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Surendra Singh Chouhan Subject: [PATCH v2] watchdog: atcwdt200: fix return value when watchdog is enabled Date: Thu, 23 Jul 2026 07:56:34 +0530 Message-ID: <20260723022634.8642-1-kr494167@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Surendra Singh Chouhan atcwdt_get_int_timer_type() returned TMR_UNKNOWN (enum value 3) when CTRL_WDT_EN was set in the control register. Because atcwdt_probe() checks "ret =3D atcwdt_get_int_timer_type(drv_data); if (ret) return ret;", returning TMR_UNKNOWN caused probe() to return 3 instead of a valid negative error code. Fix this by returning -EBUSY via dev_err_probe() when the watchdog is already enabled and update the kernel-doc description accordingly. Fixes: e4e0848ad046 ("watchdog: atcwdt200: Add driver for Andes ATCWDT200") Signed-off-by: Surendra Singh Chouhan --- drivers/watchdog/atcwdt200_wdt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/atcwdt200_wdt.c b/drivers/watchdog/atcwdt200_= wdt.c index 8e3b18aea368..7e757c217b0b 100644 --- a/drivers/watchdog/atcwdt200_wdt.c +++ b/drivers/watchdog/atcwdt200_wdt.c @@ -260,9 +260,9 @@ static void atcwdt_get_timeout_params(struct atcwdt_drv= *drv_data, * register to determine the interrupt timer type supported by the hardwar= e. * * Note: This function must only be called when the ATCWDT200 watchdog is - * disabled. If the watchdog is enabled, this function returns TMR_UNKNOWN. + * disabled. If the watchdog is enabled, this function returns -EBUSY. * - * Returns: The interrupt timer type supported by the hardware. + * Returns: 0 on success or negative error code on failure. */ static int atcwdt_get_int_timer_type(struct atcwdt_drv *drv_data) { @@ -274,7 +274,8 @@ static int atcwdt_get_int_timer_type(struct atcwdt_drv = *drv_data) regmap_read(drv_data->regmap, REG_CTRL, &val); if (val & CTRL_WDT_EN) { spin_unlock(&drv_data->lock); - return TMR_UNKNOWN; + return dev_err_probe(dev, -EBUSY, + "Watchdog is enabled, cannot detect timer type\n"); } =20 /* --=20 2.55.0