Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1016275pxb; Fri, 1 Oct 2021 01:13:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY7DbRbpohT2n5l+R1pxs/14qzFKIOXizD+pG9ZKJOQ4fsmokUcZCtMTiQgxGYzJk5BHmH X-Received: by 2002:a17:902:780f:b0:13a:3919:e365 with SMTP id p15-20020a170902780f00b0013a3919e365mr9711124pll.63.1633076016302; Fri, 01 Oct 2021 01:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633076016; cv=none; d=google.com; s=arc-20160816; b=kI0z4PNu0vBkabJaeXmnmZne+qCUJ69HInIf1p5l44RvCkKB29u8liXan8gUc4lmfF T1uTZYZBP+wpdDEsR1Yio0JbXs35UOTe+qGFHfPsMRIE6NSNb+6rQqV64WWwopNyqaq7 3UQlhrfHB8z5ZVtf/a6A0zcz2lb4pkigw4tZ9Rmg1bMPHkhQZk4vL/u2n4vAzQPT0NC5 sANhYj02cY8oKQErt2Z6zXY5Cl8CjJOk+lKWmDVR2q9nDOfIlOp9108M9B8fc7Q/H3Fn XkhJmKTjDrvg6FM+u++JuUykUyW5oJIUYMIJJ+aB3wDAnVu834eblzlrrGdkrV4THOUX KowQ== 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=vsIMDgV6HsDVUyFANZT16e8CxHCYpay6H4v/LFURY9s=; b=jbBKFYPKtAjrAQG068CQjgN0RHtgNOb/2N2SMMeMJttKirR5UM87t6rqKZniwEjCyV lDb5J/vwp5aCVXb940peVBSUSY0Y1dzN6WRRCVqNO+se4yWuv0WYNmIt1Sk+1Ap3V++y QnMy3vv3a06DEYeBKHfk/ERAi574JAqdaaNXMW4AwTf/BKGJKpKKPresVyyxKH/dOFvb UoJOWPWplW+hVOGSZiWSVa7x2r1R6ekCQtO4RHkYl47+nMzcH/rpuSHa0TYfISiZc9bX kojKL/XlCmiNZhL/6s31r9FyASiKitPdUb9yrDOd/75wGDtSMAQqit9oB6PcohGfdE8b sMkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K5wlhm4z; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si7045757pgt.22.2021.10.01.01.13.22; Fri, 01 Oct 2021 01:13:36 -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=@linuxfoundation.org header.s=korg header.b=K5wlhm4z; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352387AbhJAHQh (ORCPT + 99 others); Fri, 1 Oct 2021 03:16:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:41152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238668AbhJAHQg (ORCPT ); Fri, 1 Oct 2021 03:16:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 00CFF61246; Fri, 1 Oct 2021 07:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633072492; bh=mgLxvzAF2BEBs36gds66YnmgyvIQqLoaFwwtvzBniZE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K5wlhm4z79VFWQ5ej5mHjG0+DUsThXYtYnKy9cj54IUWqsAjVmwskUZfLHqHqopSS AEn5wGc42ZuNylUp60LIZqs9o5p4pBxIs6HYBwYm6dFXIIZ9pUI0dN/qIjTTT1aTSj CYhS3zGN8/aF7qQPeQzLxeSp3kp6vGDKnTgLckCg= Date: Fri, 1 Oct 2021 09:14:50 +0200 From: Greg KH To: "David E. Box" Cc: lee.jones@linaro.org, hdegoede@redhat.com, mgross@linux.intel.com, bhelgaas@google.com, andriy.shevchenko@linux.intel.com, srinivas.pandruvada@intel.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH 5/5] platform/x86: Add Intel Software Defined Silicon driver Message-ID: References: <20211001012815.1999501-1-david.e.box@linux.intel.com> <20211001012815.1999501-6-david.e.box@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211001012815.1999501-6-david.e.box@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 06:28:15PM -0700, David E. Box wrote: > +static int sdsi_device_open(struct inode *inode, struct file *file) > +{ > + struct miscdevice *miscdev = file->private_data; > + > + get_device(miscdev->this_device); Why do you think this is needed? Shouldn't the misc core handle all of this for you already? > + > + return 0; > +} > + > +static int sdsi_device_release(struct inode *inode, struct file *file) > +{ > + > + struct miscdevice *miscdev = file->private_data; > + struct sdsi_priv *priv = to_sdsi_priv(miscdev); > + > + if (priv->akc_owner == file) > + priv->akc_owner = NULL; Why is this needed? > + > + put_device(miscdev->this_device); I see this matches the open call, but if you do not have this in the open call, is it needed here as well? > + ret = devm_add_action_or_reset(priv->miscdev.this_device, sdsi_miscdev_remove, priv); > + if (ret) > + goto deregister_misc; I think this is all you need to clean up your device memory, not the get/put device in open/release, right? thanks, greg k-h