From patchwork Thu Aug 22 07:20:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13772880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8702C3DA4A for ; Thu, 22 Aug 2024 07:27:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=6GUNDCzUdU5ekIrWfbAr3wba/qpZf4h7cx4bxmyaZXw=; b=02TVvRE9XtExJJAjApqvh24TZa muwaPDQX31IXTHXdFrcJLeRetgkDE22/sNy9Ola/i6IIF+Ls3vEPc8VvCzsx+7LtXEWuNYFqPx+98 whABdnS1rezeK2+icXkFeYMMMcsJ2X2qEurt5fxn1ItmAzmA7+m4HOdmqM56lceAN+ss97YptwYGo v9zfhSisNDda+Zxy/bsLxg94faNjf/gU72rvjDNgEunKFiu4jJ4NocdiOfrF9tLKwVr7amO+EDRGL 0Qlgwcs47yhhkl2dMNpEx++YZShlhY9B7qUIOJT3/YFtBqpmClB/GNCGmtNRLugf2ulwPMLLssK1S IUMUPouA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh2EV-0000000BrsJ-1ylc; Thu, 22 Aug 2024 07:27:47 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh282-0000000Bpya-3kO2 for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 07:21:09 +0000 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2d5f5d8cc01so341270a91.0 for ; Thu, 22 Aug 2024 00:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724311265; x=1724916065; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6GUNDCzUdU5ekIrWfbAr3wba/qpZf4h7cx4bxmyaZXw=; b=H+qcH5wvJA6yyyvaB5G7Gm2zcl6csSql/5enuxomvBwBYDcNJlHPp4003VjfetgziZ V/ARwxtjZ40EVFeo50eitlsXHkxnZry9oxyp4BUCkhhgsp6Kdbg9H3N/hUnQ1b8NKq3K RrwWvybyfnuiZKs70IBh6+ip2kxwqXANKqTOk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724311265; x=1724916065; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6GUNDCzUdU5ekIrWfbAr3wba/qpZf4h7cx4bxmyaZXw=; b=m8uGn0c0fK7UVfTWjRDFahO+bZ8n0pEEgluTppuKYA04XnUmtzxyjnAPuNgAHcAEmQ /CENc9loRXzgX8m9ek9uvL3z8y5JH31kx/Z1Har6NJgg9TLTu1IUfMbFCdHo1twgYdw5 8wx7hx+9X8oEGfPHOZclaY2zGwHCQNVe+Lht6P0W69NrVgmwvw+9Dh0v3ZMPsWIsWlwj Eay6Il99fsF3sZ+XbupLlp+hXYaXzwSiEh/gy5DErNL85GajPQHey6CSe40+AVmAtzrv jIESmoE0tFdp+LBXv7XPY/y8y4Zy6uvcOgnFjGf2nHPfJoyySjgOCiqNFlbr06lXramx kB1Q== X-Forwarded-Encrypted: i=1; AJvYcCXyib5qkLPUr/Q3CCg1eOsaAZ48Lpx62D8w4zCNw+7qh8zB7cgzx0xu62MgMLatBR4e+/d8WQRn69twmeeNw1nk@lists.infradead.org X-Gm-Message-State: AOJu0YycZU18NaDJBzrKlfZZUf4hT4s5RYKj0viYu1alFqfRUdNhMi+H gHdpgYZ3J8QkqnEVtGY9afYetnA7covtesrquUEbQ8sAxcqIxuTtCcxRC+RqDg== X-Google-Smtp-Source: AGHT+IEGeT4MNDGST4qPH20EYpmQ5MQMaoo/kwC3GHirkZLPGoC6/6RjmNsU2lTWPtLin2scsYkQiw== X-Received: by 2002:a17:90b:3889:b0:2d3:acbd:307b with SMTP id 98e67ed59e1d1-2d60a9363b3mr3133033a91.10.1724311264866; Thu, 22 Aug 2024 00:21:04 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:8470:6a67:8877:ce2c]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7cd9ad6e8e9sm615901a12.86.2024.08.22.00.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 00:21:04 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Liam Girdwood Cc: Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/3] regulator: Minor cleanups Date: Thu, 22 Aug 2024 15:20:43 +0800 Message-ID: <20240822072047.3097740-1-wenst@chromium.org> X-Mailer: git-send-email 2.46.0.184.g6999bdac58-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240822_002107_002943_169EAEC4 X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Here are some cleanups for some bits that I saw while reworking my I2C device tree component prober to use of_regulator_bulk_get_all(). These are not directly related to that series, so I send them separately here. Patch 1 makes the regulator_get*() function misuse error message easier to understand. Patch 2 makes of_regulator_bulk_get_all() pass out the error code from regulator_get() instead of replacing it with -EINVAL. Patch 3 makes of_regulator_bulk_get_all() clean up *everything* and not touch the passed in pointer on error, and explicitly documents this behavior. Please have a look and merge if possible. Thanks ChenYu [1] https://lore.kernel.org/linux-arm-kernel/20240808095931.2649657-1-wenst@chromium.org/ Chen-Yu Tsai (3): regulator: Clarify error message for "id == NULL" in _regulator_get() regulator: Return actual error in of_regulator_bulk_get_all() regulator: Fully clean up on error in of_regulator_bulk_get_all() drivers/regulator/core.c | 2 +- drivers/regulator/of_regulator.c | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-)