Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2168334pxb; Tue, 12 Oct 2021 00:19:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXzVT6ARfAm/1XrSicXsBO4WVz0tn6D0iqGEAQke0nPvrKRhQbtOuFsoi9iawr6jb5r3rR X-Received: by 2002:a17:90b:4b4d:: with SMTP id mi13mr4025540pjb.187.1634023183842; Tue, 12 Oct 2021 00:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634023183; cv=none; d=google.com; s=arc-20160816; b=H606afiDSt9MXzyFTTO5J9vdzchU1vPmkp+3aJ5PB3mOH8ttW69bRFeKsvWyMWb9Ww /m6EbbQUB8AkRtOw7zE6Ga4QtS1M4DMrOVY6z0PP3QtMFosdte1otcw/6W/qTWjYvro0 Lu0TrYAM/m+YCaJYD6c2d6Zlx27ZB1RjdhZVNpoQMY/LNcLhnGGZPxw55O/Mv7Yc4Qom MC6YNkrfbF1ZLXg2tmmpibmkMEXeA0dbbj/dFsTAqA2NchYpxWwIjMHpvk/Xw2AVnugl yKnvKJoXoI55o54AdTgglBhUOLB0+wNFUak3IG2Bs766G/7ZOctxjymw4VG9KSkYtzgk fDGA== 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; bh=kLMMbEgJgTYfTDz1lxVF7FDbmsWw5Goa7NHiiDHT1sA=; b=IcksW+SFCM+hO+va967TPZODmGFAR/p5UiKQ2REiwkv2QNZCKFQGI8jC0xiDDN/VLm 8V6fghRTkiYnJhYwwzWe04/9aFFSGOHQ10nfnYu3KE+p1vf8+pLsnQ1fsRPGYFTPN/Sk 0JmEa2CskIuECKbgYfiV13Kg634Sacno4w3gbD72N4RUjcWxc90OElaBUQ49j1UbMxAf syhOY5CiwHo2O2W0rnkcXKQcpe5vSw1WMbRy4QXOL72bETOEbO7F6eiqjcAoVCnexHPO zfzYLBeVrZ5jueli8wPpy9ii0YVpOI9i05CUofHEw+98GBhLsTMrGT+PuqawCZX+Yslv oEdw== ARC-Authentication-Results: i=1; mx.google.com; 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 e18si2423062pjp.181.2021.10.12.00.19.31; Tue, 12 Oct 2021 00:19:43 -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; 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 S233999AbhJLHRt (ORCPT + 99 others); Tue, 12 Oct 2021 03:17:49 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:47419 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233936AbhJLHRq (ORCPT ); Tue, 12 Oct 2021 03:17:46 -0400 Received: (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 4976824000B; Tue, 12 Oct 2021 07:15:41 +0000 (UTC) Date: Tue, 12 Oct 2021 09:16:30 +0200 From: Jacopo Mondi To: Daniel Scally Cc: Krzysztof =?utf-8?Q?Ha=C5=82asa?= , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Sakari Ailus , Matteo Lisi Subject: Re: [PATCH v5] Driver for ON Semi AR0521 camera sensor Message-ID: References: <20211009102446.jrvrdr7whtd2rv4z@uno.localdomain> <20211011143420.vm6ncl5gdv44nsn3@uno.localdomain> <6c89cdb5-4920-8d01-2051-b64b804db9f6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6c89cdb5-4920-8d01-2051-b64b804db9f6@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, On Mon, Oct 11, 2021 at 11:22:10PM +0100, Daniel Scally wrote: > Hi Jacopo > > On 11/10/2021 15:34, Jacopo Mondi wrote: > >>>> +static int ar0521_remove(struct i2c_client *client) > >>>> +{ > >>>> + struct v4l2_subdev *sd = i2c_get_clientdata(client); > >>>> + struct ar0521_dev *sensor = to_ar0521_dev(sd); > >>>> + > >>>> + v4l2_async_unregister_subdev(&sensor->sd); > >>>> + media_entity_cleanup(&sensor->sd.entity); > >>>> + v4l2_ctrl_handler_free(&sensor->ctrls.handler); > >>>> + pm_runtime_disable(&client->dev); > >>>> + pm_runtime_set_suspended(&client->dev); > >>> set_suspended() then disable maybe ? > >> Other drivers seem to do it the above way but I don't know the > >> difference. > > Maybe I'm wrong but calling set_suspend() after pm_runtime() had been > > disabled seems pointless. A minor anyway as it's in the driver's > > remove function. > > > > fwiw, the kernel doc [1] for pm_runtime_set_suspended() does say that > it's not valid to call it for devices where runtime PM is still enabled. > Ah, great! thanks for pointing it out, it was very well visible in the documentation :) Sorry for the noise! Cheers j > > [1] > https://elixir.bootlin.com/linux/latest/source/include/linux/pm_runtime.h#L510 >