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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C5F0C433F5 for ; Tue, 1 Feb 2022 20:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238839AbiBAUUF (ORCPT ); Tue, 1 Feb 2022 15:20:05 -0500 Received: from mga18.intel.com ([134.134.136.126]:3651 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230400AbiBAUUE (ORCPT ); Tue, 1 Feb 2022 15:20:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643746804; x=1675282804; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fiY3yiDt5X2wwa/6G2MvYGBBH/76OgCsDl6RxLQLt6s=; b=BlnEVfSTJpF483lGoD0hnk9XVbiJmQhlllCCUFS0FdA0R58WBQs6VyX0 fiy7uaB6InK1yBaEsCIOM2JIhWdUJdUp2pW7jYJZKqWQUif4SsUF8xrIZ z3iQro6BCcUpY/XjT3Es8m0gGsQnRqHLVEdEf6bXTJ+QWwpI4iA7MgLsC c6o9eT/NST8LgBetpDSaOujxQtW0hwABsUGbnytHp72ccT0mmXIKojuMH fRC4yPErqLkRrlydVHgbZ1GgnwQ/xTv8EWhIFaFxH3OsH6HfPNuDWHfSe SlSSmZPteT8SD/Uz865JErF0YGrb920UH5Pg8+IhJcufjqzBbu4S3SsHO g==; X-IronPort-AV: E=McAfee;i="6200,9189,10245"; a="231350983" X-IronPort-AV: E=Sophos;i="5.88,334,1635231600"; d="scan'208";a="231350983" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2022 12:20:04 -0800 X-IronPort-AV: E=Sophos;i="5.88,334,1635231600"; d="scan'208";a="534635874" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2022 12:20:02 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nEzcB-00HSOz-Vo; Tue, 01 Feb 2022 22:18:59 +0200 Date: Tue, 1 Feb 2022 22:18:59 +0200 From: Andy Shevchenko To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Wolfram Sang , LKML , Linux ACPI , Mika Westerberg , linux-i2c Subject: Re: [PATCH] i2c: ACPI: Replace acpi_bus_get_device() Message-ID: References: <4374434.LvFx2qVVIh@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On Tue, Feb 01, 2022 at 08:01:46PM +0100, Rafael J. Wysocki wrote: > On Tue, Feb 1, 2022 at 7:44 PM Andy Shevchenko > wrote: > > > > On Tue, Feb 01, 2022 at 07:00:42PM +0100, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki > > > > > > Replace acpi_bus_get_device() that is going to be dropped with > > > acpi_fetch_acpi_dev(). > > > > > > No intentional functional impact. > > > > ... > > > > > + if (!adev || i2c_acpi_get_info(adev, &info, adapter, NULL)) > > > > AFAICS the !adev check is redundant since acpi_device_enumerated() does it. > > No. > > acpi_device_enumerated() returns false if adev is NULL, so without > this extra check i2c_acpi_get_info() will end up passing NULL to > i2c_acpi_do_lookup(). I see now. The patch LGTM, Reviewed-by: Andy Shevchenko > > > return AE_OK; > > > > ... > > > > > + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); > > > > > > - if (i2c_acpi_do_lookup(adev, lookup)) > > > + if (!adev || i2c_acpi_do_lookup(adev, lookup)) > > > return AE_OK; > > > > Here we need it indeed. > > Dunno, if acpi_dev_ready_for_enumeration() can gain the check itself. > > Well, acpi_bus_get_status() would need it too. -- With Best Regards, Andy Shevchenko