Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3027958pxf; Sun, 21 Mar 2021 16:07:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9LFKapTfKL6pjEulThtVmFoWhSfXOpv8jpHRRhfHd7nMZ98cI2KVuXAqhknbSRB4L3nPT X-Received: by 2002:aa7:d792:: with SMTP id s18mr22394753edq.176.1616368036047; Sun, 21 Mar 2021 16:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616368036; cv=none; d=google.com; s=arc-20160816; b=oypDxnGLDQyHyrwlmmibrWLfFSFjj0DaP2IA7oPjPOar/VaWklkPE82cyrDKwFMNhK kY5wEcIa+CuRbf//tu/C7HakaBdMk/wUy2klX77Vfyy7lSBLZTJneZYdPBro3h4CiO6z dU20gvROMsnB6esKe2g7e1Agq2h48+EkID6TpAfJW/GUhowpjlrfVPmMAyX2F+A7J2IB +xcX3BN2Rc2VbW82pXJb9WgV/SN3fxFMKBSOO2RYJh2KaImcSpkKiGxAQ19cnM5TgW1g vFp5qG6r7Xy6qgODf+uhOBRY0apWUMcnRncwE8kDFsnJt+UOqfDTlNZuD4YboeGv3ahd 6Omg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6lljKH+lDULzki+SahZ8fivj9j6DdHhqc8M0ppuQ1QI=; b=DpXBZNF2mn/YzMps9FdrPv/cJD/MY6taPd1CQBBJeQ4fmR/RMy2BAh9QHVUjQ3mEeX L6PPOylA/zlyvQul3sDdcQwaxh+ALhJ2givZWng4FGJ+YnU5E9ClKQfLf1GkVhB4PIBJ LA0Nuzlu4fQBGMvPsiIh8bZC2qo4jBZb9otrpnoLW12aWPGBfbKynx3Qprzd8ywNyLQB A53+G9ajpkGeNG1oaKMAmDOkVLRWki62yeVZCr07IXISAPNv5CqaLi7/EfBELNEK2X2E vKrympGV2wpjeTFPdxf7SbqTapa1UVDKoV4UUZ+T1kMcDKAF5INp4J1gBtrXYB9CZcoY ig2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AyKgGoek; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pj10si9413048ejb.348.2021.03.21.16.06.53; Sun, 21 Mar 2021 16:07:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AyKgGoek; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231365AbhCUVnk (ORCPT + 99 others); Sun, 21 Mar 2021 17:43:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbhCUVnP (ORCPT ); Sun, 21 Mar 2021 17:43:15 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07066C061574; Sun, 21 Mar 2021 14:43:14 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id e33so7358127pgm.13; Sun, 21 Mar 2021 14:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6lljKH+lDULzki+SahZ8fivj9j6DdHhqc8M0ppuQ1QI=; b=AyKgGoek6Hmg/KrUL+ccMAcVdumd89yfTKyuIWEaW7q2f7Ref3BaaJ8MHta4APJE5V DlOfkaNtU42qASQQxmDAUiOh5mN9LCUGpD/VtKTE+EqSmMyzstmNIaaaMPWdLQZEsGOR QuNcILj1lHbLRqgVRHeIdCXl8+BZsMjEPNzgXV0mkefUjh5lfNsIG81rAu3cbOMbn8PG IyhDZ2uuoAddzDOAFwssWqjm5RSkoeZ77j4gnkJrLqdgTuDOUIF+9p7eJooXINftk9/T ojlajNnGD8K937lMQMBedYIb1VaQnoYqwo59/6YK8FnrzBPyCMX3BIDZKTfJyp+7S9D/ bo4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6lljKH+lDULzki+SahZ8fivj9j6DdHhqc8M0ppuQ1QI=; b=nJZkTiVhSvM4PeM3GZAbheZe/LHhcTN9g3XDnC7Ix1E0d0MfjqNVj8YoHH9AotV94a byScdw7KxWqz7au+C2VaWXyoXday7ff9tQTHY7nsFI0CVFiW8a63N7Gbb9u1jQYfxUoW bu27tKGyji89700H2Dw/LX0QJce1s+WYc9B9gUIT/fKDEq0n/EBsEsxIeZyv0REv4lpS +2nnJPfp3lTT1MM8O/cfGPyCQFrz8eIS3MolKm9Me4lVz83FSWNL03fgqJEhUbnewPDw jdPNB+mtOQV/pa134dDODaalQ1uqpHyFkU8HFEvMiRo/9kuspcz7nkgCP9rnBPWyQffQ fYqw== X-Gm-Message-State: AOAM532JuBK1Cw8CoR6T+QPihmjlJYaozXZLtMsga1pzZWNrvNb8+A7l zrIcxQsS8QiMAJEzITZ+p6xOrA0DXmk= X-Received: by 2002:a63:d704:: with SMTP id d4mr19742608pgg.221.1616362994422; Sun, 21 Mar 2021 14:43:14 -0700 (PDT) Received: from google.com ([2620:15c:202:201:85c2:9df1:533a:87e9]) by smtp.gmail.com with ESMTPSA id 6sm12243826pfv.179.2021.03.21.14.43.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Mar 2021 14:43:13 -0700 (PDT) Date: Sun, 21 Mar 2021 14:43:09 -0700 From: Dmitry Torokhov To: Alistair Francis Cc: linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-kernel@vger.kernel.org, alistair23@gmail.com Subject: Re: [PATCH v3 7/9] Input: wacom_i2c - Add support for vdd regulator Message-ID: References: <20210321141049.148-1-alistair@alistair23.me> <20210321141049.148-8-alistair@alistair23.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210321141049.148-8-alistair@alistair23.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 21, 2021 at 10:10:47AM -0400, Alistair Francis wrote: > Add support for a VDD regulator. This allows the kernel to prove the > Wacom-I2C device on the rM2. > > Signed-off-by: Alistair Francis > --- > drivers/input/touchscreen/wacom_i2c.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c > index 7aa0d1c3dbc9..00db516fa3de 100644 > --- a/drivers/input/touchscreen/wacom_i2c.c > +++ b/drivers/input/touchscreen/wacom_i2c.c > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -56,6 +57,7 @@ struct wacom_i2c { > struct i2c_client *client; > struct input_dev *input; > struct touchscreen_properties props; > + struct regulator *vdd; > u8 data[WACOM_QUERY_SIZE]; > bool prox; > int tool; > @@ -203,11 +205,29 @@ static int wacom_i2c_probe(struct i2c_client *client, > struct wacom_features features = { 0 }; > int error; > > + wac_i2c = kzalloc(sizeof(*wac_i2c), GFP_KERNEL); > + if (!wac_i2c) > + return -ENOMEM; > + > if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { > dev_err(&client->dev, "i2c_check_functionality error\n"); > return -EIO; You are leaking memory here. Additionally, I do not see you removing the original allocation below, so I think you end up with 2 instances of structure wacom_i2c. Thanks. -- Dmitry