Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2443790pxv; Sat, 24 Jul 2021 16:59:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRa7Ns6TWytu96ldI6oudhT0rIQRJ3clK7nREP8kbz7wkV0Ydcrh5NpXXwX6XOe7gl6a/j X-Received: by 2002:a17:907:214c:: with SMTP id rk12mr10544901ejb.70.1627171180972; Sat, 24 Jul 2021 16:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627171180; cv=none; d=google.com; s=arc-20160816; b=yYSZ9o4T/MTQGOJZxn8+6mpaNOF/XPSLlIOI1u1cnxhTOSv/KDfKaFTFUobdseur8y DpGiL3lYwZKNKpuL4fLETrz0KVIjrtTfnFZX6o9s8nLtj/4oIB7l04W8ri4rF8kpzvCJ vIa4nCHVeDoNmBWKT9wpvSA5zdg1XanS2CxYKJK5/46tSdfD0Y5FGgLSLycYYpkfw/T4 K6qnu80JqR4ZRMkA+gkq9evXNMMVzd61BKlqg1uj4flc3sRff2Jd6TI9Bqrdv64YIsl/ O03tWae5icafwWyfmxsewKldleJcJlkK0XrdYh7Hwo36/CJnjDXqwpBHbEAuqeEomkiv Y/Dw== 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=sTT02yc54QuiI+WSS8+q0Wem8gLR0T4+uhTFU7IOQg8=; b=mlsU5KHwSkCYRHVg8OoRob+olfFBjqXwyjSGdFuFzFRDbK+GXX9iTTWD4FzKgniWpr nbVanZGJ6vtKBObtjUlhDHwhaWU01cYq2z7zmAIQehcve0ovR3DvOu+RHTl+3RwtJk+L N6T7jkgfz2hJFuOoL1RqdJo/dufavgqdCEDV0XpoNOmpjwUORKPjqbnlf1JxkZOlNQBK O3cXKe/Pa4BlF4K7bfWpO40z0tcFbogehmJs+xPBe1MhTUJ+/aqCUzbHZk1BPjlcMpqV zmKLpkpHjtGIOpgh9jE/aER8IvcRV2MpjwplicN0IbzIx5/hVc9Rdv9kidyksJf9KOui kHIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sSp8s4Hg; 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 r18si35950285edp.19.2021.07.24.16.59.01; Sat, 24 Jul 2021 16:59:40 -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=sSp8s4Hg; 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 S229853AbhGXXQM (ORCPT + 99 others); Sat, 24 Jul 2021 19:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbhGXXQK (ORCPT ); Sat, 24 Jul 2021 19:16:10 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB161C061575; Sat, 24 Jul 2021 16:56:41 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id h8so6607608ede.4; Sat, 24 Jul 2021 16:56:41 -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=sTT02yc54QuiI+WSS8+q0Wem8gLR0T4+uhTFU7IOQg8=; b=sSp8s4HgWMf2XSTI3SyPBsTQMifdhTl+17fnipaSDC2HdbVl4kIYSwc3sOBdfphUA+ wzb+AEEr8tatFpJLq1rmUJmTudqvqytThB06ZHwhb6xxUBBmUTbHy+KN7KPIxGhIB7Hr d21iOZSlj3TfKWefeEv2f+lGQkB0yRVm4gX7DVrwNbTTCyZibzQHrI2+rqwP/16Hjbys RbN4t2OikeRkwWm7zNQAwA3H+grun+qn/P7t6pKjBycb7dk9mH3Y2P3eOPuOgjKqrSM3 y7XeY+br4HHOnEZ3/qK00+cWjpmuUGmDfUGmyI2StcOfM/jbomuCt1Xr4KQyGHg8scLt 0N/g== 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=sTT02yc54QuiI+WSS8+q0Wem8gLR0T4+uhTFU7IOQg8=; b=P6dLNmtOYauvsy7X2KsvyF0MesmYc5xBkTad6PJ+KLZSoNOEcIuHbt2qiOyoSW9fMk 1F0nPojyrvkhTGB4ruJt0TjIX00IioUQaLa6xxderduaXlv138Qtye7c+82N9Z+pIUe4 RdxAdZueNfUPg9qOYbrURopZduCkGYFKhOYs9/2s5vzuy+TmjP7GVMadrxP2e9ndfjhO omsSbr86sjHs7YKlFEBMjxy83DuusrP0YO6iEFgBJpvLEK+RV/Lgt7AHvhSMkXXKYF1S 2f9lbrZND1/Hwx1hm/tAJdzMqvG0CpsBAtRa/UJ/ADKtA8kZdvSGU41+9i2UmsdhP8QL QCxw== X-Gm-Message-State: AOAM531YYT9PBDRtjjavjfsCJFJqR4Qk/iaH8Le4wPJ4Ws16NmiwL3zd B8ku454GEqFj13k2lcHeTBE= X-Received: by 2002:a05:6402:898:: with SMTP id e24mr6770361edy.197.1627171000269; Sat, 24 Jul 2021 16:56:40 -0700 (PDT) Received: from pc ([196.235.233.206]) by smtp.gmail.com with ESMTPSA id dj16sm16993384edb.0.2021.07.24.16.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 16:56:39 -0700 (PDT) Date: Sun, 25 Jul 2021 00:56:37 +0100 From: Salah Triki To: Dmitry Torokhov Cc: gregkh@linuxfoundation.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] misc: powermate: update the reference count of the usb interface structure Message-ID: <20210724235637.GA590874@pc> References: <20210724212016.GA568154@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Sat, Jul 24, 2021 at 04:08:02PM -0700, Dmitry Torokhov wrote: > > On Sat, Jul 24, 2021 at 10:20:16PM +0100, Salah Triki wrote: > > Use usb_get_intf() and usb_put_intf() in order to update the reference > > count of the usb interface structure. > > This is quite pointless as the driver will be unbound from the interface > before interface is deleted. From the documentation of usb_get_intf(): [quote] Each live reference to a interface must be refcounted. Drivers for USB interfaces should normally record such references in their probe() methods, when they bind to an interface, and release them by calling usb_put_intf(), in their disconnect() methods. [/quote] Thanx