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 E9FE5C001B0 for ; Fri, 11 Aug 2023 09:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234181AbjHKJd1 (ORCPT ); Fri, 11 Aug 2023 05:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234413AbjHKJdX (ORCPT ); Fri, 11 Aug 2023 05:33:23 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73CE3271E; Fri, 11 Aug 2023 02:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691746403; x=1723282403; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=d0hT4879fMQpRw9FZEoq0nUoQYAeQnv07LCy31EVohE=; b=QSTqdh4njowGgyCcS9Q099JAGcUQX4Vs8oGg5VjaMBMPk5ZzsODb4J1E pbh+DCYV5pPdepYPiwqz2vLWAfMN4BT6xRXyls+XIgXplj2OrVKxqrHpZ Ad8qYc3RQnClTjv+bo1gji2JWaBZNGCAziYG0TEfdYn1rXJpt63XMAytY 7oJdrlq3fo38dqM3VoMZZrU+cPVvng8IDqGriKoEdHqCBz/5CMzikRDj8 khIZhSkc8HCbwRew54VRX42j0lfwh2kf3jyx9Xgsq/iUGB1llthaji0i1 qUdEWtqyefU+/5zM+ACRdtztBxBf8G0WQnoozYUIKATJhOGmMKWlHF3Vj Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="369109561" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="369109561" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 02:33:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="735728561" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="735728561" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007.fm.intel.com with ESMTP; 11 Aug 2023 02:33:19 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qUOWC-008i8T-2V; Fri, 11 Aug 2023 12:33:16 +0300 Date: Fri, 11 Aug 2023 12:33:16 +0300 From: Andy Shevchenko To: wenhua lin Cc: Wenhua Lin , Dmitry Torokhov , Jonathan Cameron , Nuno =?iso-8859-1?Q?S=E1?= , Arnd Bergmann , Samuel Holland , Robert Jarzmik , Mattijs Korpershoek , Bartosz Golaszewski , Orson Zhai , Baolin Wang , Chunyan Zhang , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Xiongpeng Wu Subject: Re: [PATCH] input: keyboard: Add sprd-keypad driver Message-ID: References: <20230808072501.3393-1-Wenhua.Lin@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 11, 2023 at 03:31:01PM +0800, wenhua lin wrote: > On Thu, Aug 10, 2023 at 10:01 PM Andy Shevchenko > wrote: > > On Thu, Aug 10, 2023 at 08:42:36PM +0800, wenhua lin wrote: > > > On Tue, Aug 8, 2023 at 9:51 PM Andy Shevchenko > > > wrote: > > > > On Tue, Aug 08, 2023 at 03:25:01PM +0800, Wenhua Lin wrote: ... > > > > > + u32 rows_en; /* enabled rows bits */ > > > > > + u32 cols_en; /* enabled cols bits */ > > > > > > > > Why not bitmaps? > > > > > > Bitmap has been used, each bit represents different rows and different columns. > > > > I meant the bitmap type (as of bitmap.h APIs). > > I understand what you mean, I need to study how this bitmap is used. Input subsystem already is using them. ... > > > > > +static int sprd_keypad_parse_dt(struct device *dev) > > > > > > > > dt -> fw > > > > > > I don't quite understand what you mean,。 > > > is it to change the function name to sprd_keypad_parse_fw? > > > > Yes. And make it firmware (which may be ACPI/DT or something else). > > We need to think about how to modify it. As I told already, replace mention of "DT"/"OF" by "firmware" and use device property APIs as per property.h. ... > > > > And I'm wondering if input subsystem already does this for you. > > > > > > I don't quite understand what you mean. > > > > Does input subsystem parse the (some of) device properties already? > > Yes Does it cover what you are parsing here? At least partially... ... > > > > > +err_free: > > > > > + devm_kfree(&pdev->dev, data); > > > > > > > > Huh?! > > > > It's a red flag, and you have no answer to it... > > I realized the problem, the interface using devm_ does not need to do the free. > I will fix this issue in patch v2. The problem is to understand where you can and where you can't use devm_*() in the first place. _Then_ as you said. > > > > > + return ret; ... > > > > > + .owner = THIS_MODULE, > > > > > > > > ~15 years this is not needed. > > > > Where did you get this code from? Time machine? > > > > > > Do you mean the keypad driver is no longer in use? > > > > No, I meant specifically emphasized line. > > The keypad driver code is used on the platform > and has not been submitted to the community. I'm not sure I understand to what you reply here... I'm talking about the "owner" member assignment in the respective data structure. -- With Best Regards, Andy Shevchenko