Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp39738pxj; Wed, 16 Jun 2021 19:41:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEAusZSAU8SQOsXfNXss0lmMTDeQq+4JnlZW1wxqMoNgNOPeNoRaj+wZ1jq+On+2TnasIr X-Received: by 2002:aa7:d846:: with SMTP id f6mr3350583eds.341.1623897677557; Wed, 16 Jun 2021 19:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623897677; cv=none; d=google.com; s=arc-20160816; b=pKKR/4sV+LSXcAozCzq2j2g289MyiFItV+1vMgBNYVB0ZH0+rsi1J9xBElGtEKdjFF IyzTJIvc5dOJyMeIr/bkHSJQTxq8+xW2talzpx2H9xjgkwQF/fOdADxNsEq8xGFDZJet 6OVSb5AE6gB3fOhIYXXXbLesjppkmfH7V1QQ7OQw6yWpljowJRLsLeZ+dYwUDloVJIFT AlYpR6nZLBKGBgBbeG4sumL58rJGig705lTUl9ae3b0pfxP7QJ6ta0qnTqn3exuzTv8U drKgA3O34xsV1lInPAu0PGU2Np8wN2eenGqNSxNwlFUw0IKxnH6O/WCq68CIRuQU+M4v RQ2g== 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=hcsBrTVudgeXsrM7yiTkJpXzhteT1z6wPYkUUvuHXqw=; b=emG5swrvsUNsL5/u3X6wRkk3pd2MhE4s8BhBGwAcAhYd9Lhxc1H/t/V2LlEpPLph/l gKTIRXA4IS7fB/e+dyyzmqyQ5msey2Fv+oVKO0MUeZuiXX8Ci0YxYVlH1W/rrEHpTXkP s6t9kfvJmFucs2ByfRK2pDxRxYXxwRcYlTlJVoAt1GBDsRveZPfn6cp2PKLDHqsWg2Oh 8p6WyGW36Q/9Btd1rZFMyI8FcwMcK25CWtG2r20U2fIO6RKi5fHcfwL+76wE9cGmPklK YNZolB6bSpzL1IcB08x6I2Bs9MjvvxOxK7lI7Ccbi9aVqvAva4oNfpcPq0oLDBOdvRP+ 3LdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=H+XL0LVM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k20si4038476ejd.293.2021.06.16.19.40.55; Wed, 16 Jun 2021 19:41:17 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=H+XL0LVM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234910AbhFQAQ3 (ORCPT + 99 others); Wed, 16 Jun 2021 20:16:29 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:35632 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbhFQAQ3 (ORCPT ); Wed, 16 Jun 2021 20:16:29 -0400 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A523E53; Thu, 17 Jun 2021 02:14:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1623888861; bh=svs3vUIJuC6A6roJ+ePsXNyS9UtpzRg+9JcxB6phfBE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H+XL0LVMhHyfoKOfKUrxKm3zWcVdc/92j1EIOxkXOCxqZAqjnS2zFSLflpasUJH/q E+g4XHL8MinFCIbNl5NsHbFgI22sDdozqcI99hDThBlu9Qi3CFSrUmwGdJ7XAtIgZa 0YJFG+Pv8C6lx5ksMvx9K3803yZ7ZJR1NxEi/x9Q= Date: Thu, 17 Jun 2021 03:14:00 +0300 From: Laurent Pinchart To: Jacopo Mondi Cc: Hans Verkuil , kieran.bingham+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 12/15] media: i2c: rdacm20: Embed 'serializer' field Message-ID: References: <20210616124616.49249-1-jacopo+renesas@jmondi.org> <20210616124616.49249-13-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210616124616.49249-13-jacopo+renesas@jmondi.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacopo, Thank you for the patch. This should be moved before 11/15 to avoid a bisection breakage (or 11/15 should be fixed, and this patch updated accordingly). On Wed, Jun 16, 2021 at 02:46:13PM +0200, Jacopo Mondi wrote: > There's no reason to allocate dynamically the 'serializer' field in > the driver structure. > > Embed the field and adjust all its users in the driver. > > Signed-off-by: Jacopo Mondi > Reviewed-by: Kieran Bingham > Reviewed-by: Laurent Pinchart > --- > drivers/media/i2c/rdacm20.c | 36 +++++++++++++++--------------------- > 1 file changed, 15 insertions(+), 21 deletions(-) > > diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c > index 5e0314a2b1ca..029af8fd7485 100644 > --- a/drivers/media/i2c/rdacm20.c > +++ b/drivers/media/i2c/rdacm20.c > @@ -312,7 +312,7 @@ static const struct ov10635_reg { > > struct rdacm20_device { > struct device *dev; > - struct max9271_device *serializer; > + struct max9271_device serializer; > struct i2c_client *sensor; > struct v4l2_subdev sd; > struct media_pad pad; > @@ -399,7 +399,7 @@ static int rdacm20_s_stream(struct v4l2_subdev *sd, int enable) > { > struct rdacm20_device *dev = sd_to_rdacm20(sd); > > - return max9271_set_serial_link(dev->serializer, enable); > + return max9271_set_serial_link(&dev->serializer, enable); > } > > static int rdacm20_enum_mbus_code(struct v4l2_subdev *sd, > @@ -455,10 +455,10 @@ static int rdacm20_initialize(struct rdacm20_device *dev) > unsigned int retry = 3; > int ret; > > - max9271_wake_up(dev->serializer); > + max9271_wake_up(&dev->serializer); > > /* Serial link disabled during config as it needs a valid pixel clock. */ > - ret = max9271_set_serial_link(dev->serializer, false); > + ret = max9271_set_serial_link(&dev->serializer, false); > if (ret) > return ret; > > @@ -466,35 +466,35 @@ static int rdacm20_initialize(struct rdacm20_device *dev) > * Ensure that we have a good link configuration before attempting to > * identify the device. > */ > - max9271_configure_i2c(dev->serializer, MAX9271_I2CSLVSH_469NS_234NS | > - MAX9271_I2CSLVTO_1024US | > - MAX9271_I2CMSTBT_105KBPS); > + max9271_configure_i2c(&dev->serializer, MAX9271_I2CSLVSH_469NS_234NS | > + MAX9271_I2CSLVTO_1024US | > + MAX9271_I2CMSTBT_105KBPS); > > - max9271_configure_gmsl_link(dev->serializer); > + max9271_configure_gmsl_link(&dev->serializer); > > - ret = max9271_verify_id(dev->serializer); > + ret = max9271_verify_id(&dev->serializer); > if (ret < 0) > return ret; > > - ret = max9271_set_address(dev->serializer, dev->addrs[0]); > + ret = max9271_set_address(&dev->serializer, dev->addrs[0]); > if (ret < 0) > return ret; > - dev->serializer->client->addr = dev->addrs[0]; > + dev->serializer.client->addr = dev->addrs[0]; > > /* > * Reset the sensor by cycling the OV10635 reset signal connected to the > * MAX9271 GPIO1 and verify communication with the OV10635. > */ > - ret = max9271_enable_gpios(dev->serializer, MAX9271_GPIO1OUT); > + ret = max9271_enable_gpios(&dev->serializer, MAX9271_GPIO1OUT); > if (ret) > return ret; > > - ret = max9271_clear_gpios(dev->serializer, MAX9271_GPIO1OUT); > + ret = max9271_clear_gpios(&dev->serializer, MAX9271_GPIO1OUT); > if (ret) > return ret; > usleep_range(10000, 15000); > > - ret = max9271_set_gpios(dev->serializer, MAX9271_GPIO1OUT); > + ret = max9271_set_gpios(&dev->serializer, MAX9271_GPIO1OUT); > if (ret) > return ret; > usleep_range(10000, 15000); > @@ -564,13 +564,7 @@ static int rdacm20_probe(struct i2c_client *client) > if (!dev) > return -ENOMEM; > dev->dev = &client->dev; > - > - dev->serializer = devm_kzalloc(&client->dev, sizeof(*dev->serializer), > - GFP_KERNEL); > - if (!dev->serializer) > - return -ENOMEM; > - > - dev->serializer->client = client; > + dev->serializer.client = client; > > ret = of_property_read_u32_array(client->dev.of_node, "reg", > dev->addrs, 2); -- Regards, Laurent Pinchart