From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC486C43217 for ; Mon, 1 Nov 2021 10:52:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB2EA60F0F for ; Mon, 1 Nov 2021 10:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231946AbhKAKzR (ORCPT ); Mon, 1 Nov 2021 06:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231271AbhKAKzQ (ORCPT ); Mon, 1 Nov 2021 06:55:16 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D77DC061714; Mon, 1 Nov 2021 03:52:43 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id g10so62675722edj.1; Mon, 01 Nov 2021 03:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xM03mkRpggkTdZBr8UHuQHIGfbxgVsel1Sg/TRzxvtE=; b=OZVLQZBX6ycC+zd0WtmLcwS3iND3IUVSTOplKx3dfLUSP33lBUk0BJN+Bd2b/lS9XA XL9wMRP/MFAvoTceTUp6DayMgE23mo8B3DSROyEgnqhgK7ADbDUd2s9U9Tnxvwwn6nLk P0kanU8tb324IRUHAFdzmDyk6uYmq/HSzUmBv2nPvHAXag2m65of9jQiEqMlU6mLvILr +bDpSr0eTghrLo/ZKE3dCwhHg0KILpk5fzj19UyqOytvHmXTHDo9iRVk2kcF80jU4Q3c r8ZoQXHY67nem4LwX/MCriFgj+B6AasSVsIJebl5w1/sy01T+i10ygbdo5QHjPU6Jux3 L2Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xM03mkRpggkTdZBr8UHuQHIGfbxgVsel1Sg/TRzxvtE=; b=cICmw0QYlhpiyeCeZxJnzJgmbLZpRuuIeZBbNAjSwiRaFJy7ePVtNTxzSHDg6Cb5y0 NMWNCQw0HhxLyX8o7a/wehF0prx8NGz0XxRO6IHp2YxC1wbzRjZh1VO32Ogd1Hauh6aQ +6E9jr20fMe+yRYG75trs2r7q7dg1huU548x9UyhsJSrwzeI1X4M2J140NBEt9Ly3gvI OcJP6MAU7Ux+I3TYP0UzM3uweDxqMTDqw/B/eYDHrCdCAIm4mAXefunAQdEJWBFHNfaw 00Pr51obXZ8au5x80U3Ly6WPcFtXLgmhzyBEL8KPHVkDel4zUka7YWWc6yl7RAczrj3E OZ3g== X-Gm-Message-State: AOAM531DxYJwvdpECQeTu/65VkZh2ze95N7Zoh7LPgqB36cEOP9hPSmL RTr+J84RpDAZ8ApCmKTPGmVaOyWG+Catw0vR4OA= X-Google-Smtp-Source: ABdhPJyzOXykBJj/liwHHibR54egDFxo9mlJ7EqGDjocjbC5Uv7ONfzq4opnjhTRXSOWOqmCGlAvGVhNoWXfrRmh1IU= X-Received: by 2002:a17:907:7601:: with SMTP id jx1mr35568410ejc.69.1635763962122; Mon, 01 Nov 2021 03:52:42 -0700 (PDT) MIME-Version: 1.0 References: <20211025094119.82967-1-hdegoede@redhat.com> <20211025094119.82967-9-hdegoede@redhat.com> <8804fa29-d0d9-14a9-e48e-268113a79d07@redhat.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 1 Nov 2021 12:51:52 +0200 Message-ID: Subject: Re: [PATCH v4 08/11] platform/x86: int3472: Add get_sensor_adev_and_name() helper To: Hans de Goede Cc: "Rafael J . Wysocki" , Mark Gross , Andy Shevchenko , Wolfram Sang , Mika Westerberg , Daniel Scally , Laurent Pinchart , Mauro Carvalho Chehab , Liam Girdwood , Mark Brown , Michael Turquette , Stephen Boyd , Len Brown , ACPI Devel Maling List , Platform Driver , Linux Kernel Mailing List , linux-i2c , Sakari Ailus , Kate Hsuan , Linux Media Mailing List , linux-clk Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org On Mon, Nov 1, 2021 at 12:49 PM Hans de Goede wrote: > On 11/1/21 11:46, Andy Shevchenko wrote: > > On Mon, Nov 1, 2021 at 12:44 PM Andy Shevchenko > > wrote: ... > > Hmm... But then in the original code and with this proposal the > > acpi_dev_put() seems a bit strange to me. > > If we are fine (no error code returned) why would the caller (note > > _er_) go different paths? > > We always need to get the dev to get the name, but some callers are > only interested in the name, so they pass NULL for sensor_adev_ret, > this helps to keep the code calling this clean, which is the whole > idea of having a helper for this. OK. (Not that I'm very happy with this, but... the function needs a comment about this alternative behaviour, I forgot if it already has, though) -- With Best Regards, Andy Shevchenko