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 4F6D8C4332F for ; Thu, 20 Oct 2022 17:55:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbiJTRzS (ORCPT ); Thu, 20 Oct 2022 13:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbiJTRzR (ORCPT ); Thu, 20 Oct 2022 13:55:17 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B15AFFF87; Thu, 20 Oct 2022 10:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666288514; x=1697824514; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VgOcQsFKsb9PTUpe93UzLsTrOEooTIEEIGBTpePY8J4=; b=BK/1+lcLBNorC1BzpbSfcmSphmgoyZDD1g5Y/TrO1xHmzrCJ4bqVxAbr sPDuVXw7hAjl14zcrd6gJpJtOwvY9n9HTZUly4ajNiKTA1IcYtpbsTuJ4 DIYgbfEKhuygka4Nlt+f22F/h3+B41eLy7eBWxPS1Sd/uM9PmZlRCfAK7 0nXcTPKBsJEiTdOOKMIeZPZ5t4UFmWRfydn+XoqPWuc+2sMfZKX/DZA3F 3M2skzH/uxiTs81PW9LAMYRQy6P2oBh5JOpprWgVnreOCyjPaGMZF7Q+n xv1JrQSDvV5dg3rWSLt3oWRkghIQ/AXDWReEArPFH4a10i/FS3ZYz54fV A==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="306784525" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="306784525" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 10:55:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="719208411" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="719208411" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 20 Oct 2022 10:55:03 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1olZl0-00AgDi-0z; Thu, 20 Oct 2022 20:55:02 +0300 Date: Thu, 20 Oct 2022 20:55:02 +0300 From: Andy Shevchenko To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: Re: [PATCH v1 3/6] spi: pxa2xx: Remove no more needed PCI ID table Message-ID: References: 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-spi@vger.kernel.org On Thu, Oct 20, 2022 at 06:45:19PM +0100, Mark Brown wrote: > On Thu, Oct 20, 2022 at 08:41:43PM +0300, Andy Shevchenko wrote: > > > Okay, would it work for you if we check the named resource and only if it's > > found take a property? In such case we can guarantee (AFAICS) that the 3rd > > parties (like unknown firmware) won't mess up with the driver. > > Not sure I quite get what you're proposing here but I *think* so, > assuming you mean checking the values if the property is present (and > error out if the property isn't there at all and you're instantiating > via a MFD rather than direct PCI/DT binding I guess)? When we instantiate via MFD, we (semi-)manually create resources for each of the children. These resources may or may not have a dedicated names. Those names can be given _only_ inside the source code in the kernel, so it means it is _explicit_ telling, that we are know where the device in question comes from. In the code it will be like if (resource_with_name_present()) { ret = device_property_... if (ret) return ERROR "No mandatory property provided"; } Like you said, checking property only when we have resource present _by name_ and bail out if there is none. -- With Best Regards, Andy Shevchenko