Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp292255pxm; Wed, 2 Mar 2022 15:37:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwLSMrSCMR5OgLrdhBPnbI3UZpuLEt+DhWF4abQX9EjACJ5DQKPUcH7GKjxZye1Jc6WlCu X-Received: by 2002:a05:6a00:16cd:b0:4e1:366:7ee8 with SMTP id l13-20020a056a0016cd00b004e103667ee8mr35406890pfc.9.1646264234782; Wed, 02 Mar 2022 15:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646264234; cv=none; d=google.com; s=arc-20160816; b=WEQNtu4/6cF/hoP6/qAPHoATrxxEQhHxHQfMlVkdHcw5SgXB6OvAuFsVTsBF7oy3FI Dl0/hITKj6b/io4uE5K6lQCE/ljCnjX1Igm4wHw+rsJcZpeIkecUTVAkSERIU+hO+2I/ zxUrxeI3D4y6oGE2RKrxHtSAsCW5WJAA//v2ayHwb5d1x7khW0jMacLqH+7zW2xM8Ac+ 7iAbiDfOXRnay3/xl/6NhEAz3UvBnpV693yBjHTA9pyR8xs/Oelr41nPUHwiU+QvCzqR uS9bEd1mc3y5zd4G3Zfq/BU6DuMczuqorEh46cbrZYFdgmdTuLxqv16MJdP8iJT1F7fF 8tmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bCoxThg0BgDvUZW1SxPOzG8xYONpAW2nI0hT5dyuJ+8=; b=EyWTX3S62Fun15Z7ZmY+XndQUZhiVWdk3gEPyxrkL+G6npfqxfX5LZJCaWHDgy3NoI Vw3oKNZ0zJ8h5qjlJQlSFM7iXhqiZjTT0A4G5x7MgsHIZi6PoCaUBJ43VXdCPBtKr+Sa 3UVUZJ/B9yJMm4hQniozAliq6ufE7B7+MhgfCFGJ88/nBOVIT63TRaEB/WBvSV233qca bcVeQvuLIO8aDbf74ZJxCNf5S7jVfKk5i6Lsd5rlicFfy+T9veUliAtntCRg9RUZZr/C 7b3eRhKrhOhYEIT7i+IDiDi7JtzsyL29Us3kQnZ/Vra4MJmRNrDS2lX588wUgMg4CCfG ZiTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=E1UR1coO; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z2-20020a63b902000000b003758cfb6291si445629pge.204.2022.03.02.15.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:37:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=E1UR1coO; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CC68315A21D; Wed, 2 Mar 2022 15:04:58 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242355AbiCBTw3 (ORCPT + 72 others); Wed, 2 Mar 2022 14:52:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241654AbiCBTw2 (ORCPT ); Wed, 2 Mar 2022 14:52:28 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E0BD95CF for ; Wed, 2 Mar 2022 11:51:43 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id qt6so5985922ejb.11 for ; Wed, 02 Mar 2022 11:51:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bCoxThg0BgDvUZW1SxPOzG8xYONpAW2nI0hT5dyuJ+8=; b=E1UR1coOBUydg9tjcKe22ruZqfCSDhM8R7IJODWapeZsAxvyy4jn/PAi/rQaR/hF+r lwgKyboCRZ0HUB2m87y+bb+wL8R+yWJt57q8LxUNLzx+jn6pfayuTTANn4ESI3h3IdTr o2yPn/XEPE5z8hCEOt0z9EvL8t2pA+pQp9r1Skjasu9DIUB+ylij8HgXHXPTKEzxzTlz Nyoo7UsPJRcBKWjnRsavcMA3zdFXpMRcXJRxnzvDZuoNsNmDKYWrKQSGqNAeYCMXGwGO DWmUn2BuzcNDpKc4llw0v/YtscpDVbNzuV+zpFhFPMBSOhrvFFXMurGguOfzXpSreRGj Ekzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bCoxThg0BgDvUZW1SxPOzG8xYONpAW2nI0hT5dyuJ+8=; b=iuNrjzV4+SsnpEn2iiA1hYBqY+RdJSMLvdD+r/HvIYSFkBDgDF/QwqAeK9bEbY2GkU Ra6lpPlrndwUa239bVozpzhcONi13tRFzxhGt+juK6uuloOqpVA566c1c7HjP0Ho19CJ ES6SPCZ+eqxcqoVgxP6aYw8Gg+KA8E+7/fEBv6mvi2/IIz45kWovSdSPIsqDqnY1CAh6 Z9XwydZRUnJYpzmBmH7HFkhrjHkXoB2nziqVshxP/tbahR+SJ4JAtkyYcvufVk6k2FE/ chYRaRotTuaSDWPyWyUrKYgeiNzCdcGi01GXyyIgFqZa8WSNyjA5K2j4eAE8PJp+ONue NrdA== X-Gm-Message-State: AOAM530dRUBL4+te4gYZnjTTDlRiRRd2T8FRwO6einWs/NaPhgRUVHlD 3MzEs7GIgHdKCRvF4d+rtDJGSsgZXk4= X-Received: by 2002:a17:907:3f9e:b0:6da:842e:873e with SMTP id hr30-20020a1709073f9e00b006da842e873emr1144996ejc.383.1646250701706; Wed, 02 Mar 2022 11:51:41 -0800 (PST) Received: from debian64.daheim (p5b0d776b.dip0.t-ipconnect.de. [91.13.119.107]) by smtp.gmail.com with ESMTPSA id qx13-20020a170906fccd00b006bdeb94f50csm6592339ejb.203.2022.03.02.11.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 11:51:38 -0800 (PST) Received: from chuck by debian64.daheim with local (Exim 4.95) (envelope-from ) id 1nPV0c-000IP3-HH; Wed, 02 Mar 2022 20:51:38 +0100 From: Christian Lamparter To: linux-wireless@vger.kernel.org Cc: Kalle Valo Subject: [PATCH v1 3/5] carl9170: devres-ing input_allocate_device Date: Wed, 2 Mar 2022 20:51:36 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: <0036538d0933626a1a5eb2c2c3935cf173028926.1646250537.git.chunkeey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org devres will take care of freeing the input_device once it is no longer needed. Signed-off-by: Christian Lamparter --- drivers/net/wireless/ath/carl9170/main.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c index 9495b3da1978..e833052e9056 100644 --- a/drivers/net/wireless/ath/carl9170/main.c +++ b/drivers/net/wireless/ath/carl9170/main.c @@ -1494,7 +1494,7 @@ static int carl9170_register_wps_button(struct ar9170 *ar) if (!(ar->features & CARL9170_WPS_BUTTON)) return 0; - input = input_allocate_device(); + input = devm_input_allocate_device(&ar->udev->dev); if (!input) return -ENOMEM; @@ -1512,10 +1512,8 @@ static int carl9170_register_wps_button(struct ar9170 *ar) input_set_capability(input, EV_KEY, KEY_WPS_BUTTON); err = input_register_device(input); - if (err) { - input_free_device(input); + if (err) return err; - } ar->wps.pbc = input; return 0; @@ -2038,13 +2036,6 @@ void carl9170_unregister(struct ar9170 *ar) carl9170_debugfs_unregister(ar); #endif /* CONFIG_CARL9170_DEBUGFS */ -#ifdef CONFIG_CARL9170_WPC - if (ar->wps.pbc) { - input_unregister_device(ar->wps.pbc); - ar->wps.pbc = NULL; - } -#endif /* CONFIG_CARL9170_WPC */ - carl9170_cancel_worker(ar); cancel_work_sync(&ar->restart_work); -- 2.35.1