From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx4.wp.pl (mx4.wp.pl [212.77.101.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D34B2AD2E for ; Thu, 23 Jul 2026 08:33:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.77.101.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784795603; cv=none; b=YiJ83I/x+/Jf7Im8rFIJKTLDa7K8llrBs8x0j7duKUzgSF7aQy0PG8ToJO2KdMsi4RT9OJmBylZevLH09vzGU8DgTACAzutuDt1PsRsz1OpBQHoeuf0N7B7/Pgw3XIJICODP7NQSnEg8Dsu12lwWEWFDxjO0Wzs2PyOxVAC6f3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784795603; c=relaxed/simple; bh=UGeOF6Qgse1F02GFrP8rFb3Y+xAc13XsQLnd7/VOuDA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k0rvj8vaFMIfNEjCP+0oeyOJUa+i1OlMMRLtpYgGfyFoVKKIiYgPaTS3tu4HB4lCOeFqpfRVCmC7eUA4ZJL9VPSVoMZ6xfeDGlvsVSAXz7cztTSWm5R1X/8Jao60BeEINf4dNqfFA8gwvv+pViE8D02hzgUNy8zkKygEDV9YWlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl; spf=pass smtp.mailfrom=wp.pl; dkim=pass (2048-bit key) header.d=wp.pl header.i=@wp.pl header.b=Ms/xoC2z; arc=none smtp.client-ip=212.77.101.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wp.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wp.pl header.i=@wp.pl header.b="Ms/xoC2z" Received: (wp-smtpd smtp.wp.pl 22432 invoked from network); 23 Jul 2026 10:33:11 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=20241105; t=1784795591; bh=Ri5m/BcfITOpl40vNOHEdVtvGXnlsWi7fcTjJcW7gBs=; h=From:To:Cc:Subject; b=Ms/xoC2zV48629GLfFxH9DnY9z66nJ2OKmkIYR9M0ip22HXiGrmhBO60XmKQttS2m L4/JTRReQivtljmhZ40SWqXNwSr7sH3rshVn3imwF+btBWRfja4TA73byu6rWzu494 dQ/qFnChVfEdclfGWeY45KYb1yaOcWeDWod/MvJYuvwmwHs3JVMwxJmsL/JCCsW4qh zXb5IHoyvO7gpJFugmLdnLmmh1lo2QFVHiSaYHCno4Q+cI16YSVB2JebWbGJ1W0lGc ZiSaTdD3frHSQKKoHhqdTOTmNJzqZg2PTAdRh18Sg1/F1uXXt4cOOyUlac5a5ZmCwE qLKyv2NcmW0vw== Received: from 77-236-11-167.static.play.pl (HELO localhost) (stf_xl@wp.pl@[77.236.11.167]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with TLS_AES_256_GCM_SHA384 encrypted SMTP for ; 23 Jul 2026 10:33:11 +0200 Date: Thu, 23 Jul 2026 10:33:10 +0200 From: Stanislaw Gruszka To: Rosen Penev Cc: linux-wireless@vger.kernel.org, open list Subject: Re: [PATCH wireless-next] wifi: rt2x00: Use device-managed register buffers Message-ID: <20260723083310.GC4577@wp.pl> References: <20260717220052.824624-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260717220052.824624-1-rosenp@gmail.com> X-WP-MailID: 99da899a07fd48a92231d014ce85229b X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000000 [cQNB] On Fri, Jul 17, 2026 at 03:00:52PM -0700, Rosen Penev wrote: > The rt2x00 PCI and USB probe paths allocate EEPROM and RF storage with > plain kzalloc() and then free it from bus-specific teardown helpers. The > USB path also manages the CSR cache the same way. These buffers are > tied to the device lifetime, so the explicit free paths add probe and > disconnect cleanup without providing separate ownership. > > Allocate the buffers with devm_kzalloc() before the mac80211 hardware is > allocated, then attach the resulting storage to struct rt2x00_dev after > the driver-private state exists. This lets driver detach and probe > failure rely on device-managed cleanup and removes the duplicated > bus-specific buffer freeing. > > Assisted-by: Codex:GPT-5.5 > Signed-off-by: Rosen Penev Acked-by: Stanislaw Gruszka > int rt2x00usb_probe(struct usb_interface *usb_intf, > const struct rt2x00_ops *ops) > { > struct usb_device *usb_dev = interface_to_usbdev(usb_intf); > - struct ieee80211_hw *hw; > struct rt2x00_dev *rt2x00dev; > + struct ieee80211_hw *hw; > + __le16 *eeprom; > + void *cache; > int retval; > + u32* rf; Nit, u32 *rf; Regards Stanislaw