835d1cd4c5
This driver is actually an external kernel module that was imported into the kernel tree. You can find the original driver of Boban Loïc at https://github.com/2pecshy/eeprom-ST25DV-linux-driver.git Changes done by Fa. WAGO: - refactor the probe and detect functions to align with modern Linux kernel best practices: - Switch to Managed Resources: Replaced standard kmalloc/kzalloc with devm_kmalloc/devm_kzalloc for all data structures and buffers. This simplifies the probe function and eliminates the need for most memory-related goto labels and manual kfree calls. - Automatic Device Management: Integrated devm_add_action_or_reset to handle the automatic unregistering of the dummy I2C client, ensuring safer resource release during error paths and removal. - Modernized Logging: Replaced generic pr_warn/pr_info calls with device-specific dev_err, dev_info, and dev_dbg for better traceability in systems with multiple I2C devices. - Improved String Handling: Replaced the deprecated strlcpy with the safer strscpy in the detection phase. - Enhanced Status Reporting: Added detailed dev_info upon successful probe, including the specific chip model name and detected memory capacity. - Coding Style Fixes: Standardized indentation, removed unnecessary braces for single-statement blocks, and structured area-specific initializations to improve readability and maintainability. The driver was tested and seems to be working fine. Signed-off-by: Heinrich Toews <ht@twx-software.de>